0% found this document useful (0 votes)
5 views20 pages

FinalProject24 PatrickMartinRuben WinningFinalPremierLeagueWithML

Siiuei3iziid

Uploaded by

Mohamed Mrimi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views20 pages

FinalProject24 PatrickMartinRuben WinningFinalPremierLeagueWithML

Siiuei3iziid

Uploaded by

Mohamed Mrimi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 20

Winning FPL with Machine Learning

Patrick Timmermans, Martin Vestergaard og Ruben Engmose


The game
Our goal
Get as many point as
possible!

And win the game


Data
The road to a complete team
- Model
- Multiple models for different predictions
- Criteria: Lightning fast (and accurate)
- Team selection
- Running through approx. 10e+21 combination in seconds
- Inspired by the idea of recursive elimination used in feature selection
- Team scoring & line-up
- Model tuning
The road to a complete team
Model tuning
- One output but a ton of parameters
- And training times of more than 30 minutes
- Focus on players that are likely to make the team
- Only looking for ‘value’ players
- Weights
- Essentially this made tuning any parameter very hard
- Every attempt of hyper-optimisation was
- Lack of model tuning?
(Dis)advantage opposed to expert knowledge
- It understood:
- Match weeks
- Team strengths
- General player values

- It did NOT understand:


- Basic strategies regarding positions, rotation and substitutions
- It would buy Nick Pope, bench him for four rounds and sell him
- Which players were definitely not playing
- Other publicly available information
- The more advanced rules
Player Example - 3 features over 5 seasons (190 gameweeks)
SLTM - Setup
- Goal: Predict the form of a player and use prediction as a feature
- Train-test split: Train 4 seasons - Predict 1 season (Time homogeneous)
- First idea: Train on all players and predict for each individual player
- How to create “train groups”?
- Separate model and train for each position (Hand plucked 5 players in each)
- Keeper
- Defence
- Midfield
- Striker
- Predict for individual players based on position
- Is the model and training data representative for the individual player?
Player example - SLTM prediction result
Prediction SLTM result and discussion
Possible Improvements
- Predict 1-5 matches each round with updated information (Instead a whole season)
- Choose representative players with least correlation
- How do we split our models? (Position, volatility, team, ...)
- How to reduce overfitting? (Train on more players)
- How to validate model? (Predicting on different types of players)
Fundamental constraints
- Few players with enough data (Conditional on players)
- Overall: Volatile and nearly impossible to predict (At Least not more than 5+ GW)
- “Enough data”?
Results
Appendix
- FPL_data.ipynb

- Score_team.py

- Select_team.py

- FPL_Hacked.py

- Hyper_param_optim.py

- PL_SLTM.ipynb
References
SLTM Setup:
https://towardsdatascience.com/illustrated-guide-to-lstms-and-gru-s-a-step-by-step
-explanation-44e9eb85bf21

Data:
https://github.com/vaastav/Fantasy-Premier-League
FPL_data.ipynb
Gets the available data from: https://github.com/vaastav/Fantasy-Premier-League
combine the player data with the team data, to construct the dataset we use for
training.
Making new variables such as Form, Last rounds ICT-index, Points scored until
given gw, a team-code which is consistent over different seasons and informations
about the next 5 gws.
Lastly combining rows concerning gws where a player plays more than one game,
and constructing missing rows, where players have a blank gw.

gw = Gameweek/one round of the game


FPL_hacked.py
The main script keeping track of game week at iterating throughout the season.
From here is made all the references to the remaining scripts. It takes
FPL_DATA.csv as input generated from FPL_data.ipynb.

For each game week, it trains two LightGBM models used respectively to predict
the points in the following round and another to predict multiple rounds ahead.

It calls the two files score_team.py and select_team.py, which, as their title
indicates, handles the team composition and the team scoring.
FPL - Form_prediction_SLTM.ipynb
The script illustrations the variation of different features over gameweeks for
different players

We set up the test size/train window and the LSTM model. Here we also set the
forward, loss and optimizer functions.

We train the model on specific groups of players by position.

The model is trained over 100 epocs for each “train player”.

At last, we plot the predicted form over the actual form for the last season and
export all form predictions as a new feature in a csv file
Feature importance
Model predicting 4 rounds ahead
Feature importance
Model predicting 1 rounds ahead

You might also like