All projects

Parc Fermé

An F1 model that sets every driver's chance to win, reach the podium, score points or retire once qualifying is done, and publishes it every race weekend.

The problem

The starting grid is a hard baseline to beat: most drivers finish close to where they start. The question was whether a model could beat it, and, more usefully, put honest numbers on the outcome. The grid says who starts first. It can't say he's 31% to win, or that another driver has a one-in-three chance of not finishing.

How it works

  • Session results from 2022 to 2026 through FastF1, without car telemetry, which the race order doesn't need.
  • Only features that carry across rule changes: grid, qualifying and teammate gaps, long-run practice pace, form and how hard the track is to pass on. 2026 races weigh three times as much.
  • An XGBoost ranker grouped by race, checked walk-forward so it never trains on a race it is scored on.
  • Win, podium and points odds from a Plackett-Luce simulation, plus a separate retirement model.
  • It runs itself: after qualifying it fetches the official grid (penalties never show up in the timing data), predicts, rebuilds the site and scores the race afterwards, from a scheduled task or GitHub Actions when my PC is off.

What broke

  • The first download was 992 MB for six sessions, almost all telemetry. Dropping it brought ten sessions to under 1 MB and made a full 2022–2026 pull practical.
  • More features made it worse. With about 30 training races the full feature set overfit; grid plus qualifying beat it. The rest now has to earn its place in a backtest.
  • Penalties were invisible. A 12-place grid drop at Monza wasn't in any timing message, so the model now reads the official starting grid from formula1.com, with OpenF1 as backup.
  • The order doesn't beat the grid. Across 48 races of 2024 and 2025 the predicted order landed within the margin of error of the grid. So the product became the percentages, which the grid can't give.

How it has done live

Predictions made after qualifying and scored after each race, from Baku 2026 on (6 races so far).

Podium finishers called

Model78%
Starting grid56%

Finishing order (Spearman)

Model0.78
Starting grid0.63

Race winner called

Model67%
Starting grid83%

It calls podiums better than the grid but picks the winner less often, and Polymarket's pre-race odds still score better on the winner. Six races is a small sample, so the next step is a rerun on the full data set to prune features.