Skip to content
Carlos Guzman

F1 Forecast Lab

An ML pipeline that forecasts Formula 1 qualifying and race results, with a dashboard that compares predictions to what happened.

The F1 Forecast index on deepspace.com.mx, listing 2026 events with predictions.
Fig. 1 — F1 Forecast on DeepSpace Labs: one page per event with predictions.

Problem

A forecasting model that sees data from after the event looks brilliant in testing and fails on race day. F1 Forecast Lab is a pipeline built to test its predictions honestly.

My role

I was the main developer of F1 Forecast Lab, a DeepSpace project.

Approach

  • Data. A Python monorepo managed with uv ingests session data with FastF1, with leakage checks that keep future information out of training.
  • Models. Logistic regression, LightGBM and XGBoost, with calibration, compared on backtests at both event and season level.
  • Operations. The f1-weekend operator CLI drives each run, and results sync to Supabase.
  • Dashboard. A Next.js dashboard shows predicted against actual results.
The F1 Forecast Lab pipelineRace data comes in through FastF1 and passes leakage checks. Logistic regression, LightGBM and XGBoost models, with calibration, are compared on event- and season-level backtests. The f1-weekend operator CLI and a Supabase sync feed a Next.js dashboard of predicted against actual results.FastF1 ingestionPython · uv monorepoLeakage checksModelslogistic · LightGBM · XGBoost, calibratedBacktestsevent- and season-levelf1-weekendoperator CLISupabase syncDashboardNext.js · predicted vs actual
Fig. 2 — From FastF1 data to the dashboard.
Race results for the 2026 Azerbaijan Grand Prix: each driver's predicted chance of scoring points next to the points actually scored.
Fig. 3 — The dashboard's predicted-against-actual view for one race.

Outcome

Live, with the qualifying and race models done.

I compared logistic regression, LightGBM and XGBoost on 11 five-event windows, rolling from the 2023 season. Logistic regression and XGBoost rank drivers about equally well, but XGBoost's probabilities are closer to what happened: it has the lower Brier score on 5 of the 6 targets. XGBoost is the model in production for both qualifying and the race.

TargetXGBoost ROC AUCLogistic ROC AUCXGBoost BrierLogistic Brier
Reaches Q30.8800.8780.1430.142
Qualifies top 50.9100.9120.0970.110
Qualifies top 30.9080.9070.0830.110
Finishes in the points0.8540.8500.1540.158
Finishes top 50.9320.9300.0840.095
Podium0.9270.9290.0750.097
Fig. 4 — Event-level backtests, XGBoost against logistic regression. Higher ROC AUC is better; lower Brier score is better.

Code walkthrough available on request.