Textbook stop
79%One lap before he pitted on worn mediums, for the reasons a strategist would give: tyre age and pace drop-off.
I trained a model to predict F1 pit stops from public timing data, explained it two different ways, and tested whether those explanations hold up. They were honest about the model and caught real mistakes. On any single lap, though, they often disagreed.
Will this driver pit in the next three laps? The model only sees what the pit wall knows at that moment.
Two models, explained two ways. XGBoost is a black box, explained afterward with SHAP. An Explainable Boosting Machine (EBM) is a glass box: its prediction is literally a sum of one score per factor, so its explanation is exact.
Tested on races it never saw. Trained on 2023–24, tested on 2025, then stress-tested on 2026, when the cars, engines and tyres all changed.
No peeking at the future. No race appears in both training and testing, in-laps are dropped, and the safety-car feature uses only each driver's own next lap.
PR-AUC on the unseen 2025 season (higher is better; random guessing scores the pit rate). It warns before 69% of real stops, but most of its alerts are false alarms. Useful but often wrong, which is exactly when its reasons need checking.
Both methods say which factors pushed each prediction toward or away from a stop. Here is whether those reasons can be trusted.
Across the season they rank the factors almost identically. On a single lap, they usually share only two of their top three reasons.
Rank correlation of average importance · top-3 overlap per lap (Jaccard)Retrain XGBoost five times with different random seeds and SHAP tells the same story every time.
Mean pairwise rank correlation across 5 seedsRemove SHAP's top reason and the predicted pit chance halves. Remove a random factor and it barely moves (36%).
Deletion test on 1,285 laps where XGBoost predicted a stopNew cars, engines and tyres, and the model reasons about pit stops almost exactly as before.
Rank correlation of SHAP importance, 2025 vs. 2026Each step replaces one more of a lap's top-ranked factors with a value from a random other lap. A faithful ranking makes the line drop fast.
Average influence on the pit prediction (log-odds) on the 2025 season. Same leaders, different weights.
The most useful moments came when an explanation didn't match how F1 strategy actually works. Each one led to a change, re-tested on races the model had never seen.
Temperature varies about 9°C between races but only 1.3°C within one, so the model was using it to recognize which race it was. SHAP was faithful; the model's reason was bad. Faithful isn't the same as meaningful.
Yet 27% of stops happen the lap a safety car or VSC appears. Adding "safety car on the driver's next lap" raised 2025 PR-AUC from 0.319 to 0.330.
It won on the 2024 development data and lost on 2025. Every explanation-driven fix has to be re-tested.
Mean PR-AUC over 5 seeds; whiskers show ±1 standard deviation. Dropping temperature entirely did best, a reminder that the "fix" I kept was chosen before seeing 2025.
Right for the right reasons, saved by debugging, and confidently wrong. Open any of them in the replay to see the reasons lap by lap.
One lap before he pitted on worn mediums, for the reasons a strategist would give: tyre age and pace drop-off.
Russell pitted under a VSC on fresh tyres. The safety-car feature added after debugging is what flagged it.
Sure he would stop, but he ran to lap 46 on tyres that were still fast. The model learned what teams usually do.
The explanations were honest about the model and helped fix it. But on a single lap two methods often disagree, and the model is often wrong. Use explanations to debug a model, not to justify a single call.
Every 2025 and 2026 race, none of which the model saw in training. Drag along the chart or use the slider to pick a lap, then compare the two explanations of that call.
Shaded laps: safety car or VSC. Dashed line: the model's "box" threshold. Tyre strip shows each stint's compound.
Twelve real moments from 2025 and 2026. Read the timing screen, make the call, then see what the model said, why, and what the team actually did. A stop counts if it happened within three laps.