Skip to content

Commit 9fce324

Browse files
committed
Update readme
1 parent 77985df commit 9fce324

File tree

1 file changed

+44
-73
lines changed

1 file changed

+44
-73
lines changed

README.md

Lines changed: 44 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -27,104 +27,75 @@ The _Fantasy Premier League Team Optimizer_ employs data-driven methods for anal
2727
## Why Model Training is Essential
2828
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.
2929

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.
3132

32-
### `backevel`
33+
## `backevel`
3334
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.
3435

35-
### `conf`
36+
## `conf`
3637
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.
3738

38-
### `ml_model`
39+
## `ml_model`
3940
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.
4041

41-
### `optimizer`
42+
## `optimizer`
4243
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.
4344

44-
### `populator`
45+
## `populator`
4546
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.
4647

47-
### `transfer`
48+
## `transfer`
4849
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.
4950

5051
## `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.
5253

5354
## 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:
5556

5657
```bash
57-
# Builds local player database.
58-
python3 -m lazyfpl.populator
58+
# Populate the database with team data.
59+
fpl
5960

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.
62+
fpl train
6263

63-
# Backeval the model (optional).
64-
python3 -m lazyfpl.backevel
64+
# Train the ML model with custom parameters.
65+
fpl train --epochs 10 --lr 0.005 --min-mtm 70 --upsample 20 --batch-size 32
6566

66-
# Optimize team selection based on various criteria.
67-
python3 -m lazyfpl.optimizer --no-news --min-mtm 60
68-
```
67+
# Show the player database.
68+
fpl show --top 5 --no-news
6969

70-
Obs! Step 1 and 2 must be run every gameweek to optain any new data.
70+
# Pick transfer options based on specified constraints.
71+
fpl transfer 2 --add Salah Haaland --exclude Alexander-Arnold --min-mtm 65 --min-xp 7.0
7172

73+
# Optimize the best possible lineup based on given constraints.
74+
fpl lineup --budget-lower 950 --include Haaland --max-players-per-team 2 --min-xp 6.5
7275

73-
## optimizer
74-
Summary of lazyfpl.optimizer Command Output
75-
76-
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 TP UD Team Position Player Upcoming News
91-
X 20.9 57.0 65 -0.2 Wolves FWD Cunha Chelsea - Brentford - Everton
92-
X 19.7 76.0 58 0.6 Newcastle FWD Isak Luton - Nott'm Forest - Liverpool
93-
X 17.5 139.0 112 0.9 Man City FWD Haaland Everton - Sheffield Utd - Newcastle Foot injury - 50% chance of playing
94-
X 18.4 49.0 36 -0.2 Fulham MID Cairney Burnley - Bournemouth - Arsenal
95-
X 16.9 76.0 71 0.9 Man City MID Foden Everton - Sheffield Utd - Newcastle
96-
16.1 132.0 127 0.1 Liverpool MID Salah Arsenal - Burnley - Newcastle
97-
15.8 57.0 50 -0.5 Nott'm Forest MID Gibbs-White Bournemouth - Newcastle - Man Utd
98-
14.7 50.0 42 -0.2 Fulham MID J.Palhinha Burnley - Bournemouth - Arsenal
99-
X 31.1 43.0 22 -0.2 Fulham DEF Tosin Burnley - Bournemouth - Arsenal
100-
X 20.6 44.0 45 -0.1 Bournemouth DEF Senesi Nott'm Forest - Fulham - Spurs
101-
X 18.2 82.0 75 0.1 Liverpool DEF Alexander-Arnold Arsenal - Burnley - Newcastle
102-
X 17.9 44.0 38 -0.5 Nott'm Forest DEF Toffolo Bournemouth - Newcastle - Man Utd
103-
X 17.9 44.0 23 0.2 Aston Villa DEF Diego Carlos Sheffield Utd - Man Utd - Burnley
104-
X 16.1 46.0 57 -0.1 Bournemouth GKP Neto Nott'm Forest - Fulham - Spurs
105-
15.9 55.0 46 0.9 Man City GKP Ederson M. Everton - Sheffield Utd - Newcastle
106-
107-
Price: 99.7 Size: 15
108-
LxP: 215.2 SxP: 278.0 CxP: 351.6
109-
Schedule score: 15 Team score: 14 TSscore: 20.52
110-
BIS xP Price TP UD Team Position Player Upcoming News
111-
X 20.9 57.0 65 -0.2 Wolves FWD Cunha Chelsea - Brentford - Everton
112-
X 19.7 76.0 58 0.6 Newcastle FWD Isak Luton - Nott'm Forest - Liverpool
113-
X 17.5 139.0 112 0.9 Man City FWD Haaland Everton - Sheffield Utd - Newcastle Foot injury - 50% chance of playing
114-
X 18.4 49.0 36 -0.2 Fulham MID Cairney Burnley - Bournemouth - Arsenal
115-
X 16.9 76.0 71 0.9 Man City MID Foden Everton - Sheffield Utd - Newcastle
116-
16.1 132.0 127 0.1 Liverpool MID Salah Arsenal - Burnley - Newcastle
117-
15.8 57.0 50 -0.5 Nott'm Forest MID Gibbs-White Bournemouth - Newcastle - Man Utd
118-
15.0 53.0 59 -0.2 Fulham MID Andreas Burnley - Bournemouth - Arsenal
119-
X 31.1 43.0 22 -0.2 Fulham DEF Tosin Burnley - Bournemouth - Arsenal
120-
X 20.6 44.0 45 -0.1 Bournemouth DEF Senesi Nott'm Forest - Fulham - Spurs
121-
X 18.2 82.0 75 0.1 Liverpool DEF Alexander-Arnold Arsenal - Burnley - Newcastle
122-
X 17.9 44.0 38 -0.5 Nott'm Forest DEF Toffolo Bournemouth - Newcastle - Man Utd
123-
X 17.9 44.0 23 0.2 Aston Villa DEF Diego Carlos Sheffield Utd - Man Utd - Burnley
124-
X 16.1 46.0 57 -0.1 Bournemouth GKP Neto Nott'm Forest - Fulham - Spurs
125-
15.9 55.0 46 0.9 Man City GKP Ederson M. Everton - Sheffield Utd - Newcastle
76+
# Show differentials based on specified criteria.
77+
fpl differential --min-mtm 70 --min-selected 500 --min-xp 6.5 --top 3
78+
79+
# Validate the accuracy of the model's predictions.
80+
fpl backeval
81+
82+
# Show the current team.
83+
fpl team
12684
```
12785

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+
12899
## 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!
129101

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

Comments
 (0)