Skip to content
SamSafePublic

About

Fantasy Premier League squad planner that forecasts player points and compares transfers, captains, lineups, and chip timing across gameweeks.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Gaffe

Gaffe is a Fantasy Premier League squad planner. It forecasts player points over several gameweeks and compares the expected return from making a transfer with the return from keeping your squad.

App guide · Mobile view · Model design · Run locally

The gameweek overview in Gaffe’s desktop dashboard

Gameweek planning

Decision What Gaffe shows
Spend a transfer or roll it The projected points gain over holding, accounting for selling prices, available funds and transfer hits.
Pick the matchday squad A starting XI, bench order and captain that fit the formation and club limits.
Time a chip Suggested gameweeks for the available chips across the planning horizon.
Review a decision The points earned by recommendations saved before the deadline, once the gameweek is complete.

Forecast and optimization

Gaffe estimates playing time, goals, assists, clean sheets and bonus points using player history, set-piece roles and market-implied team strength. A Monte Carlo simulation combines these outcomes into a distribution of points for each player. A mixed-integer optimizer then selects a squad and plans transfers within the game’s budget and roster constraints.

The Python implementation uses Polars and PostgreSQL for historical inputs, LightGBM for prediction, and Pyomo with CBC for optimization. Prediction model · Squad optimizer · Set-piece observations

Historical benchmark

Each evaluation trained on prior seasons and compared Gaffe with a buy-and-hold squad over 38 gameweeks, with chips disabled.

Season Gaffe Buy and hold Points gained
2024/25 2,508 2,104 +404
2025/26 2,331 1,994 +337

Some closing odds and player metadata postdate the gameweek deadlines. These figures can therefore overstate what a manager could have achieved live. A full season of pre-deadline forecasts is still needed to measure live performance. Benchmark methodology and limitations

Run on the migrated Windows PC

Open Start-Gaffe.cmd from the project folder to start the local database and dashboard. The launcher uses the Windows virtual environment and the private PostgreSQL cluster under %LOCALAPPDATA%\Gaffe on loopback port 55432. The database URL is in the ignored .env file.

Run locally

Install Python 3.11 or later and uv. From the repository root, install the dependencies and inspect the CLI.

uv sync --all-extras
uv run gaffe --help

Configure PostgreSQL using the app guide, then apply the migrations and launch the dashboard.

uv run alembic upgrade head
uv run gaffe serve

The dashboard opens at http://127.0.0.1:8080. Generating forecasts also requires CBC and a populated training database. App setup · Forecast runbook

About

Fantasy Premier League squad planner that forecasts player points and compares transfers, captains, lineups, and chip timing across gameweeks.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages