Inspiration

I have watched Formula 1 for more than two years, and I want to work in this field. So I decided to improve my Python by building a race analysis tool.

What it does

Formula Analyst is a race analysis dashboard for every Grand Prix weekend from 2018 to the latest 2026 round, from first practice to the race.

  • Race: positions and gaps lap by lap, a timing screen for any lap, a replay on the track map, pace and tyre degradation, pit stops and undercuts, and two drivers' fastest laps compared channel by channel.
  • Strategy: a model trained on races since 2019 predicts how much time each tyre compound loses, and a simulator ranks one- and two-stop plans against the winner's.
  • Race predictions: after qualifying, a model trained on every race since 2018 predicts the finishing order, and after the race it shows how close it came.
  • Championship: standings after any round, who can still win the title, simulated title chances and teammate head-to-heads.

Race replay

Strategy simulator

How I built it

The app is written in Python with pandas, Plotly and Streamlit. Timing data comes from FastF1 and OpenF1, and results and standings from the Jolpica F1 API. Every session ships with the app as Parquet files. The tyre-wear and race-prediction models use scikit-learn.

A GitHub Actions job adds each weekend's sessions, updates the championship and retrains the models. The app runs in Docker behind Nginx, with 173 unit tests in CI.

Tyre model

This is an unofficial, non-commercial project and isn't affiliated with any racing series or its rights holders.

Built With

Share this project:

Updates