Building an F1 Race Dashboard That Admits What It Cannot Measure
Every F1 dashboard starts the same way: pull the timing data, plot it, add a model, put a big accuracy number in the header. I built that version first. Then I read my own README and could not defend half of it.
This is the rebuild, and the constraint that shaped it: a number the page cannot justify does not go on the page.
What the data actually gives you
The public surface is better than it used to be. OpenF1 serves live timing, intervals, stints, race control, and 4 Hz car telemetry. FastF1 wraps the historical timing API and caches sessions locally.
What neither gives you is a clean race narrative. You get frames:
- Lap times per driver, per stint, with gaps that need reconstructing
- Telemetry that covers some drivers and silently misses others
- Results that include sprint sessions you must not confuse with race sessions
- JSON where a pit stop is a timestamp, not a decision
The first version I shipped treated that mess as an inconvenience to smooth over. That is how a dashboard ends up drawing a confident car icon at a position nobody measured.
The rule that changed the design
Each module now carries a written honesty contract at the top. The strategy simulator states that every number it returns is an estimate, labels the confidence from the sample size behind it, and lists the assumptions the projection rests on:
``
good >= 15 clean laps
moderate >= 8 clean laps
low >= 2 clean laps
insufficient < 2 clean laps
`
With no per-driver data, the level is insufficient, which is the honest label for a projection that is just constants. The page shows that label. It does not hide it under a tooltip.
The replay player follows the same rule. Lap times, gaps, stints, and race order are measured. Position on track is estimated from lap progress and the UI says so. A driver with no telemetry is labelled, not rendered reading zero, because a zero in a speed trace reads as "this car stopped" and that is a different claim.
The model, stated plainly
Here is where I have to be careful, because this is the part most dashboards oversell.
The forecast is a ridge regression on five features, each built only from rounds before the race being predicted:
- Grid position
- Team pace
- Driver form
- Positions gained
- DNF rate
When there is too little history to fit (under two training rounds, or under two rows per coefficient), it falls back to a documented hand-weighted heuristic: grid 0.40, team pace 0.35, form 0.25. The output carries an Engine column saying which one produced the number. The fallback is never silent.
Why a backtest, not an accuracy claim
Grid position is strongly predictive in F1. A model that cannot beat "the finishing order equals the grid" is adding nothing, and most of them cannot.
So the project scores it properly. The backtest walks the season race by race. Each race is scored by a model trained only on the rounds before it, and the result is compared against that naive baseline. It reports the sample size for every race, skips races with too few drivers instead of averaging them in, and states plainly whether the model beat the baseline.
When the model loses, the page says the model lost. That is the feature.
What the eight pages are
- Championship standings with sprint points included and race points kept separate
- Points progression accumulated round by round
- Race analysis: lap times, position changes, gap to leader, pit stops, tyre stints
- Broadcast replay: a scrubber over a track map, with timing tower and race control
- Strategy simulator: what-if tyre plans with expected time, risk, and assumptions
- Sector insights: per-sector deficits against session best, with clean-lap counts
- Setup and aero proxy: trap speed, cornering buckets, a shift detector between sessions
- Competitor watchlist: head-to-head records and circuit history with sample confidence
Making it readable to someone who does not watch F1
The data was never the hard part. The vocabulary is. "Undercut", "stint", "rolling average" mean nothing to a new viewer, and a tooltip that explains them mid-chart is a tooltip nobody opens.
So every page gets the same treatment:
- A hero band that states what is happening in one plain sentence
- A "What this means" line after every chart and table
- One shared glossary of 30 terms, defined in English and Indonesian, reachable from every page
- A "New to F1? Start here" button in the sidebar that explains the sport in four steps
The glossary switches language; the data labels and charts stay in English on purpose. A half-translated page is worse than a consistent one.
What I learned
Honesty is an architecture decision, not a disclaimer. Labelling a figure estimated` is trivial. Building the code so every derived number is forced through a function that attaches its sample size is what keeps the label true six months later. A baseline is the most useful thing you can add. Without "the result is the grid" as a reference, a mediocre model looks like a good one. With it, the reader can see whether the work is real. Design tokens scale further than features do. Every page uses one component library, one chart height scale, one table style. That is what makes eight pages read as one tool instead of eight demos.Try it
The dashboard runs on Streamlit. If the public deploy has gone to sleep, open it once and it wakes up.
The source is at github.com/knsiuss/f1lab, and the honesty contract for each module is in the docstring at the top of the file, written before the code below it.
---
More projects at kanisius.dev