Skip to content

Fournierp/FPL

Repository files navigation

Fantasy-Premier-League

Introduction

Fantasy Premier League related analytics. In this repository, I conduct data analysis on the numerous facets of football and particularly apply it to the fantasy game.

Installation

Firstly, ensure that you have pip install. In which case follow these steps using the command line:

curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
python get-pip.py

Then install the required libraries listed in the requirements.txt

pip install -r requirements.txt

Usage Example

Fixture Predictions

Note: Prior to running this, add the command line argument with predict if you want to see the prediction for next gameweek and backtest if you want to save evaluate the model on a whole season.

python3 modeling/fixtures/dixon_coles.py

FPL Team Optimization

Note: Prior to running this, one should have downloaded the gameweek prediction data and saved it in folder: data/fpl_review/SEASON/gameweek/GAMEWEEK.

python3 optimization/team_optimization.py

Features

  • Github Actions to scrape:

    • Daily betting odds
    • FiveThirtyEight SPIs before the games
    • FPL ownership data per gameweek
    • FPL Review Predictive data (Deprecated)
  • Optimization of FPL Team

  • Predictions of match scores

Release history

  • 0.0

    • Data collections of managers season data through the Official Fantasy Premier League API.
  • 1.0

    • Github Actions scraper
    • Basic gameweek FPL Team optimization
    • Benchmark match scores predictive models
    • Football analysis metrics
  • 2.0

    • FPL Optimization Dashboard
    • Master Thesis code

    Demo

Acknowledgements

FPL - Official data on player ownership, chips used etc.

Football-Data.co.uk - Historical Football Results and Betting Odds Data

FBref - Football Stats and History Statistics, scores and history

FiveThirtyEight - Forecasts and Soccer Power Index (SPI) ratings

FPL Review - FPL Predictions

Logos - Premier League clubs logos

Understat - Shot Expected goals and locations

Forecast-Based Optimization Model for Fantasy Premier League - Linear Optimization model

sertalpbilal/FPL-Optimization-Tools - Tutorials and recipes to use optimization for winning Fantasy Premier League

livefpl.net - Best 1000 Managers of All Time

vaastav/Fantasy-Premier-League - Historical FPL data

Contribute

To build on this tool, please fork it and make pull requests. Or simply send me some suggestions !

Authors