Coder Social home page Coder Social logo

ritviyer / fpl-team-prediction Goto Github PK

View Code? Open in Web Editor NEW
8.0 1.0 3.0 114.81 MB

Fantasy Premier League prediction using Machine Learning

Python 100.00%
soccer football fpl fantasy-premier-league python machine-learning understat linear-programming

fpl-team-prediction's Introduction

FPL-Team-Prediction

This project uses machine learning to predict the fantasy premier league performance of each player.

  • current year/ - Current season's FPL data of each player
  • data/ - Historical FPL data of each player
  • prediction/ - Each gameweek's prediction data as well as model predictions
  • training-data_2016-19/ - Training data from previos seasons
  • CalculatingFunctions.py - Functions to shift rows, fill Nan values, calculate average of features in last few select gws
  • FetchFPLData.py - Functions to fetch team and player data using FPL APIs - (Fixture, gw data, player history, etc)
  • FetchUnderstatData.py - Functions to fetch team and player data from understat - (player xG, xA, team results, offensive/defensive form, etc)
  • GBMFPLModel.py - Build an XGBoost model for points prediction
  • LinearRegressionFPLModel.py - Build a Linear Regression model for points prediction
  • RandomForrestFPLModel.py - Build a Random Forest model for points prediction
  • GetTeamPoints.py - Fetch gameweek points of each player using FPL APIs
  • MapUnderstatToFPL.py - Functions to match and Consolidate the player's FPL and understat data
  • PickTeam.py - Use Linear Programming to pick optimal team
  • PreparePredictionData.py - Gather data for each player to make a prediction for the following gameweek
  • PrepareTrainingData.py - Gather historical data for each player for training the models
  • ReadFPLData.py - Read and process the collected FPL data of each player

For each gameweek, the models are trained using all historical data prior to that week starting from the 2016/17 season. Some of the features used are:

  • Player performance in the season so far, ex - goals, assists, clean sheets, bonus points, minutes played, etc
  • Understat player data such as xG, xA and more
  • Offensive and defensive form of the player's team
  • Offensive and defensive form of the opponent team

After points forecast, Linear Programming is used to find an optimal team.

A comparison of the performance of all models will be added at the end of the season.

Acknowledgments

Sincere thanks to:

fpl-team-prediction's People

Contributors

ritviyer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

fpl-team-prediction's Issues

Extension - Team prediction

Hi, the project looks quite interesting.
What would you change to make this work for Serie-A instead? Is all the training data downloaded automatically at some point?

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.