← All work 2025Live product

LapByLap

F1 Fantasy gives you a budget and asks for five drivers and two constructors. LapByLap runs each race weekend 10,000 times from real timing data, then finds the team with the best expected points for the amount of risk you want to take. Over the 2026 season its predictions have ranked drivers correctly 82% of the time. It is live and I maintain it myself.

  • Python
  • FastAPI
  • React
  • PostgreSQL
  • Three.js
  • Docker
  • NumPy
  • Pandas
  • PuLP
Results
82%
directional accuracy
90%
top-5 hit rate
0.78
Spearman rank correlation

Why simulate

Most Fantasy advice is built on last race’s results. That hides how much a race can swing. A cheap driver with a good chance of finishing in the points can be worth more than an expensive one who retires every few weekends.

So LapByLap treats a race as a spread of outcomes and picks a team against the whole spread.

How it works

  • Driver models. Timing data from FastF1 gives each driver a qualifying and race pace distribution, a tyre wear rate and a chance of not finishing.
  • Race simulation. Each run plays the race lap by lap, with tyre wear, fuel burn, traffic, safety cars and retirements adding noise to the order.
  • Team selection. A linear program (PuLP) picks the lineup within the budget and team limits. It scores teams on expected points minus a penalty for variance, so risk is a setting you can turn.
  • The app. A FastAPI backend with PostgreSQL, a React front end with a Three.js view, packaged with Docker and running on its own domain.

What the app shows

  • Race view. Simulated finishing positions for each driver, including how the position changes lap by lap and how wide the range of outcomes is.
  • Value charts. Price against expected points for drivers and constructors, so you can see who is cheap for what they score.
  • Risk against reward. A quadrant of expected points against variance, which is where the risk setting comes from.
  • Methodology page. The modelling is written up in the app itself, so the numbers can be checked.

Choosing a team

You pick the budget cap and how much risk you are willing to carry. The optimiser then returns the lineup with the best score under the game’s real rules: five drivers, two constructors, a limit on drivers from one team, and the cost ceiling. Move the risk setting and the lineup changes, which makes the trade-off easy to see.

How it has done

Each race I compare the model’s predictions with what actually happened. These are the numbers for the 2026 season, and what each one measures.

MetricIn plain terms2026 season
Directional accuracyPick any two drivers: how often the model correctly says who scores more. 50% is a coin flip.82%
Top-5 hit rateOf the five drivers the model rates highest, the share that finish in the real top 10.90%
Spearman correlationHow well the predicted ranking of drivers matches the real one. 1 is identical, 0 is no relationship.0.78
MAETypical miss on a single driver’s fantasy points, in points. Lower is better.10.4 average (6.8 to 18.5 by race)
BiasWhether the model leans high or low overall. Close to zero is what you want.-0.4 points
80% coverageHow often the real result falls inside the model’s 80% range. Ideal is about 80%.79%

The modelling in a bit more detail

Qualifying and race lap times are modelled as normal distributions fitted to each driver’s history. Simulated qualifying gaps set the grid. Race lap time then adds tyre degradation, fuel effect, a traffic penalty and safety-car effects, with each driver’s volatility taken from how consistent their pace has been.

The optimiser maximises total expected points, adds credit for the best scorer on the team, and takes off a penalty for portfolio variance, normalised by cost.

Caveats

  • Tyre strategy is simplified and weather is modelled only roughly.
  • It needs a decent amount of history per driver, so rookies and mid-season swaps are weak spots.
  • The figures cover a single season, so treat them as a snapshot rather than a guarantee.
  • A wet or safety-car-heavy race can still land well outside the predicted range.