FinalProject24 PatrickMartinRuben WinningFinalPremierLeagueWithML
FinalProject24 PatrickMartinRuben WinningFinalPremierLeagueWithML
- 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.
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.
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