Giter VIP home page Giter VIP logo

football-prediction-model's Introduction

Multinomial Logistic Regression Model to predict football outcomes

Purpose of Project

The main goal of this project is to present usability and build Machine Learning Model based on Multinomial Logistic Regression for predicting the results of football matches (the English Premier League was used as an example for the analysis). Script presents the process of data exploring and cleansing, model building and evaluation and practical use to predict the outcomes of future football matches. Source data includes statistics since the 2011/2012 season to the mid-2021/2022 season.

🔸 Source CSV files come from the site https://www.football-data.co.uk/

Built with

◾ tidyverse

◾ mice

◾ caTools

◾ nnet

◾ corrplot

◾ e1071

◾ yardstick

◾ ggplot2

Description of used variables

◾ Date - Match date (dd/mm/yy format)

◾ HomeTeam - Name of Home Team

◾ AwayTeam - Name of Away Team

◾ FTHG and FTAG - Full Time Home and Away Team Goals

◾ FTR - Full Time Result (H - Home Team Win, D - Draw, A - Away Team Win)

◾ HTHG and HTAG - Half Time Home and Away Team Goals

◾ HTR - Half Time Result

◾ HS and AS - Home and Away Team Shots

◾ HST and AST - Home and Away Team Shots on Target

◾ HF and AF - Home and Away Team Fouls Committed

◾ HC and AC - Home and Away Team Corners

◾ HY and AY - Home and Away Team Yellow Cards

◾ HR and AR - Home and Away Team Red Cards

Full description of variables and dataset available at Football-Data Notes.

Minimal Code to build Model

train <- read.csv("./training/training.csv")
train$FTR <- relevel(factor(train$FTR), ref = "D")

require(nnet)
multinom.model <- multinom(FTR ~ AST + HST + AF + HC + AC + HY + HR + AR + 1, data = train) 

summary(multinom.model)      

Prediction Quality

Model Accuracy: 0.5955

Pros and Cons of solution

➕ High sensitivity of Home Team victory result prediction

➕ High specificity of Draw result prediction

➕ Lot possibilities to improve prediction efficiency for example, by extending the model with new variables

➖ Low sensitivity of Draw result prediction

➖ Medium level of overall accuracy

Model applying

◾ Premier League 2021/2022 Matches Results Prediction Outcome

◾ Premier League 2021/2022 Matches Results Prediction Details

Icons

Forecasting icons created by Flat Icons - Flaticon

Bet icons created by max.icons - Flaticon

Copyright (c) 2021 Paweł Pechta

football-prediction-model's People

Contributors

pawelp0499 avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.