Giter Site home page Giter Site logo

allen-zengr / football-prediction-web-app Goto Github PK

View Code? Open in Web Editor NEW

This project forked from dimasikson/football-prediction-web-app

0.0 0.0 0.0 51.75 MB

Web app that helps to visualize football predictions. Predictions done with Gradient Boosted Decision Trees.

Python 52.76% JavaScript 34.28% HTML 6.84% CSS 6.11%

football-prediction-web-app's Introduction

Football predictor web app

1. What is this?

This is a web app that helps to visualize football predictions and how each input variable affects the output. Below is an example of a match report. Each bar represents the marginal contribution of the corresponding variable on the output.

2. How was it done?

2.1 Modelling

We use Gradient Boosted Regression Trees to predict the goal difference of a game, Home team goals [minus] Away team goals. Boosted trees are a great choice for this as it performs well with tabular data with non-linear interactions with the output. Below chart explains how the residuals of each tree are fed into each next tree, thus performing gradient boosting:

Source: https://www.geeksforgeeks.org/ml-gradient-boosting/

The algorithm also pairs well with the SHAP package which helps to explain each prediction by assigning marginal impact on the output to each input variable:

Source: https://github.com/slundberg/shap

Below we can see the model performance in terms of accuracy and ROI:

alt text

All data taken from: https://www.football-data.co.uk/

2.2 Deployment

  • Model training is done offline, inference is done daily with a scheduled data refresh
  • Backend is done in Flask
  • Frontend is done with vanilla JS, HTML, CSS
  • Website hosted on Azure App Service, using Azure Blob Storage for storing data

3. Why was it done?

This web app is primarily for demonstration of data preprocessing, data modeling and some basic web development. The secondary purpose is to use it myself :)

4. Feature glossary

Below is an explanation for each feature in the model:

  • Home/Draw/Away odds: European style odds for each outcome. If odds are 1.82 -> you pay 1.00 unit and receive 1.82 in case of a win.
  • Goals + (H/A): Cumulative average goals scored
  • Goals - (H/A): Cumulative average goals concered
  • Conversion (H/A): Shot-to-goal conversion, Goals / Shots on target
  • Accuracy (H/A): Shots on target / Shots
  • Pts average (H/A): Cumulative average points obtained
  • Pts in last 3 (H/A): Average points in the last 3 games
  • Table position (H/A): Position in the table, treated as a continuous variable
  • Variance (H/A): Deviation of actual result from odds for each team. High variance means team has produced more surprising results, whether positive or negative

football-prediction-web-app's People

Contributors

dimasikson avatar allen-zengr 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.