F1 AI Race Predictor

A machine learning dashboard that predicts F1 qualifying positions, race outcomes, and safety car probabilities using practice session telemetry, built as a tool for thinking about race strategy, not just consuming results.

F1 AI Race Predictor
The ML Framing Decision

F1 race prediction is seductive but mostly noise if framed wrong. Predicting outright podium finishers sounds compelling but the sport has too many confounding variables: strategy calls, safety cars, weather, tyre degradation curves that differ by track temperature. A model predicting "Verstappen wins" tells you nothing you didn't already know. The more honest and tractable problem is predicting qualifying-to-race position deltas, which measure how much a driver typically gains or loses from grid position to race finish, given their practice pace data? This is where the data is actually predictive. A driver who is consistently fast in long runs relative to their qualifying pace tends to overperform their grid position. The XGBoost model was trained on this framing, and the feature importance reflects it: long-run pace delta and sector consistency matter more than raw qualifying lap time.

Built using Python, Streamlit, XGBoost, Pandas, NumPy, Plotly, FastF1 API, Scikit-learn

Key Decisions & Outcomes
  • XGBoost model predicts qualifying-to-race position deltas rather than outright winners, a more tractable framing where practice telemetry is actually predictive
  • Safety car probability model trained on circuit characteristics and historical incident rates that gives a pre-race variance estimate useful for thinking about strategy
  • Grid comparison mode shows sector-by-sector breakdowns for any two drivers across all practice sessions
  • FastF1 API caches telemetry locally, ensuring the dashboard stays fast even when pulling multi-season historical data

If you're curious, feel free to explore: