You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+44-73Lines changed: 44 additions & 73 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -27,104 +27,75 @@ The _Fantasy Premier League Team Optimizer_ employs data-driven methods for anal
27
27
## Why Model Training is Essential
28
28
In this application, training a machine learning model is critical as it allows for nuanced understanding and prediction of FPL player performances. By analyzing historical data, the model identifies patterns and trends, offering forecasts about future player performances. These predictions are invaluable for strategic team selection and transfer decisions, providing users with a significant edge in the game.
29
29
30
-
## Modules Overview
30
+
# Modules Overview
31
+
Each module in this application contributes a specific functionality to the overall performance of the Fantasy Premier League Team Optimizer, ensuring a comprehensive and efficient experience for users.
31
32
32
-
###`backevel`
33
+
## `backevel`
33
34
The `backevel` module is designed to validate the accuracy of the model's predictions against real-world player performances. It serves as a critical tool for assessing the model's effectiveness, enabling users to understand and improve the predictive capability of the system. This module is especially useful for refining the model's algorithms to enhance its future forecasting accuracy.
34
35
35
-
###`conf`
36
+
## `conf`
36
37
The `conf` module is where users can customize the application's settings and parameters. This flexibility allows for personalization according to individual strategies and preferences. It's crucial for users who want to adapt the application's functionality to their unique play style or specific requirements in the FPL.
37
38
38
-
###`ml_model`
39
+
## `ml_model`
39
40
The `ml_model` module is at the core of the application. It uses machine learning algorithms to analyze historical data and predict future player performances. This predictive capability is what makes the application so powerful for FPL players, offering insights that can inform strategic decisions for team selections and transfers.
40
41
41
-
###`optimizer`
42
+
## `optimizer`
42
43
The `optimizer` module combines the insights from the `ml_model` with the constraints defined by the user to suggest the best possible team setups. It is a sophisticated tool that leverages both data-driven predictions and user-defined strategies to maximize the performance of an FPL team.
43
44
44
-
###`populator`
45
+
## `populator`
45
46
The `populator` module is responsible for filling the database with data from external sources. This module ensures that the database has comprehensive and up-to-date information, which is crucial for the accuracy of the model's predictions and the effectiveness of the optimizer.
46
47
47
-
###`transfer`
48
+
## `transfer`
48
49
In the `transfer` module, users receive guidance on managing player transfers, influenced by the model's predictions and optimization algorithms. This module helps users make informed decisions about player transfers, combining data-driven insights with strategic planning for improved team performance.
49
50
50
51
## `differentials`
51
-
The differentials module is a specialized tool designed for the Fantasy Premier League Team Optimizer. It offers analytics to identify potential differential picks in your fantasy football team. Differential picks are players who are not widely selected by other managers but have the potential to score high points, thereby giving you an edge in the competition.
52
+
The `differentials` module is a specialized tool designed for the Fantasy Premier League Team Optimizer. It offers analytics to identify potential differential picks in your fantasy football team. Differential picks are players who are not widely selected by other managers but have the potential to score high points, thereby giving you an edge in the competition.
52
53
53
54
## Command Line Interface (CLI) Usage
54
-
This application features a CLI, implemented via `argparse`, for straightforward interaction and execution. Below are command examples for key operations:
55
+
The application features a CLI implemented via `typer`, allowing for a more intuitive and flexible interaction. Below are command examples for key operations:
55
56
56
57
```bash
57
-
#Builds local player database.
58
-
python3 -m lazyfpl.populator
58
+
#Populate the database with team data.
59
+
fpl
59
60
60
-
# Train ml-model (used to estimate expected points per player).
61
-
python3 -m lazyfpl.ml_model
61
+
# Train the ML model on the populated data with default training parameters.
The lazyfpl.optimizer command, with the parameters --no-news --min-mtm 60 --include Salah Haaland Alexander-Arnold, generated several team combinations for the Fantasy Premier League, focusing on optimizing the team with specific constraints and player inclusions.
77
-
78
-
- Key Players Included: The optimization specifically included Mohamed Salah, Erling Haaland, and Trent Alexander-Arnold, key players known for their high impact in FPL.
79
-
- Player Analysis: The output provided detailed analytics on various players, including expected points (xP), price, total points (TP), and upcoming matches. Notably, Erling Haaland was mentioned with a foot injury and a 50% chance of playing.
80
-
- Team Statistics: The command calculated different metrics like 'Price', 'Size', 'LxP' (Likely points), 'SxP' (Scheduled points), and 'CxP' (Combined points), providing a comprehensive overview of the team's potential performance.
81
-
- Optimization Results: The optimizer assessed numerous combinations of goalkeepers, defenders, midfielders, and forwards, totaling an astronomical number of potential team setups (in the range of 4.4e+15).
82
-
- Team Performance Scores: The summary includes schedule scores, team scores, and total scores (TSscore), indicating the balance between the team's schedule, individual player performance, and overall team synergy.
83
-
84
-
This summary provides a snapshot of the optimizer's output, showcasing its capabilities in assessing player performances, predicting future outputs, and suggesting optimal team configurations based on the given parameters
85
-
86
-
```python
87
-
Price: 99.4 Size: 15
88
-
LxP: 215.2 SxP: 277.7 CxP: 351.3
89
-
Schedule score: 15 Team score: 14 TSscore: 20.52
90
-
BIS xP Price TPUD Team Position Player Upcoming News
91
-
X 20.957.065-0.2 Wolves FWD Cunha Chelsea - Brentford - Everton
92
-
X 19.776.0580.6 Newcastle FWD Isak Luton - Nott'm Forest - Liverpool
93
-
X 17.5139.01120.9 Man City FWD Haaland Everton - Sheffield Utd - Newcastle Foot injury -50% chance of playing
94
-
X 18.449.036-0.2 Fulham MID Cairney Burnley - Bournemouth - Arsenal
95
-
X 16.976.0710.9 Man City MID Foden Everton - Sheffield Utd - Newcastle
96
-
16.1132.01270.1 Liverpool MID Salah Arsenal - Burnley - Newcastle
# Validate the accuracy of the model's predictions.
80
+
fpl backeval
81
+
82
+
# Show the current team.
83
+
fpl team
126
84
```
127
85
86
+
Obs! Ensure to run the `populate` and `train` commands each gameweek to update the data and train the model on the latest statistics.
87
+
88
+
## optimizer
89
+
### Summary of `fpl lineup` Command Output
90
+
The `fpl lineup` command allows users to optimize their Fantasy Premier League lineup based on specified criteria. The output provides several optimized team combinations, considering key parameters such as budget, selected players, and expected points.
91
+
92
+
Key features:
93
+
-**Player Selection**: Specific players like Salah, Haaland, or Alexander-Arnold can be explicitly included or excluded based on the user's preferences.
94
+
-**Team Metrics**: The output contains analytics on each player, including expected points (xP), price, upcoming matches, and additional news like injuries or suspensions.
95
+
-**Optimization Scores**: Metrics like Likely points (LxP), Scheduled points (SxP), Combined points (CxP), and Schedule score indicate the potential performance of the chosen lineup.
96
+
97
+
This summary captures the key metrics and potential lineups, showcasing the power of the optimizer in assessing player performances and building optimal team configurations.
98
+
128
99
## Acknowledgments
100
+
Special thanks to the maintainers of the [Fantasy-Premier-League](https://github.com/vaastav/Fantasy-Premier-League) library. This invaluable resource has been instrumental in providing comprehensive and up-to-date FPL player statistics, game-week specific data, and historical performance records. Their dedication to maintaining and updating this library plays a crucial role in enhancing the capabilities of our "Fantasy Premier League Team Optimizer" and the FPL community at large. Your efforts are greatly appreciated!
129
101
130
-
Special thanks to the maintainers of the [Fantasy-Premier-League](https://github.com/vaastav/Fantasy-Premier-League) library. This invaluable resource has been instrumental in providing comprehensive and up-to-date FPL player statistics, game-week specific data, and historical performance records. Their dedication to maintaining and updating this library plays a crucial role in enhancing the capabilities of our "Fantasy Premier League Team Optimizer" and the FPL community at large. Your efforts are greatly appreciated!
0 commit comments