In previous fantasy football drafts, I have struggled to pick the right players. At the start, I selected players whose point projections were not dramatically different than the projections of players who were still available in later rounds. At the end, I failed to draft backups for players who were at the most risk of injury.
This project is my attempt to solve both of those problems. To better estimate whether a player is especially valuable in a given round, a Monte Carlo simulation uses a logistic regression of historical draft data to guess which players will be available in later rounds of the draft, ensuring that I never pick a player who is easily replaceable. And to more accurately anticipate which players need strong, rostered backups (not streamers), injuries and other setbacks are randomly assigned to players, based on historical data, so I always load up on talented individuals in my most at-risk positions.
To get the simulator started, you must have Docker installed on your machine.
Clone this repository, and run in its directory:
docker-compose up -d
The frontend of the application will then be viewable on localhost:3000
.
To correctly return results for your league, you'll need to tune the variables in backend/models/config.py
to your league's settings and create a couple of CSV files:
This file includes player names, positions, and projected points for the current NFL season from any resource you choose, like The Athletic. The projected points should align with your league's scoring rules.
The following columns are required:
- Season
- Player
- Pos
- Team
- Projected FFP
Like players.csv
, this file should include player names, positions, and projected points for previous seasons. Additionally, it should include a column that tallies the actual number of points a player scored in that year.
The following columns are required:
- Season
- Player
- Pos
- Team
- Projected FFP
- Actual FFP
This file informs the logistic regression that models how other teams in your league are predicted to pick. Ideally, it should be a reformatted download of your league's draft history for previous years. For example, Sleeper provides an API for accessing draft histories.
The following columns are required:
- Pick
- Pos
This file provides the details for each team in your league. Other information, like whether the simulation should replicate a snake draft, should be contained within the .env
file for FastAPI, which is read by backend/models/config.py
.
The following columns are required:
- Name
- Order
(draft order)
- Owner
- Simulator
(True/False or 1/0)
Technically, more than one team may be the simulator – or be owned by the user executing the program - allowing the user to test every pick of the draft.
The following screenshots are samples from the NextUI frontend, which automatically includes both dark
and light
themes that require very little customization.
The program is ready for 2024 fantasy football drafts, but it is still a work in progress. If you find it valuable but notice bugs, need changes, or require additional features, open an issue or fork to start a PR.
Thank you for your interest, and good luck in your draft!