Real-Time ML
Apex
Real-time F1 pit-wall strategy simulator that runs 10,000 race simulations in under 0.2 seconds.
0.996
R² accuracy
01 — Problem
Race strategists need to predict how a driver's lap times will evolve as tires degrade, fuel burns off, and track position changes, then simulate thousands of "what if" scenarios — different pit windows, undercuts, safety cars — fast enough to matter in a live race.
02 — Approach
- 01
Two-stage ML pipeline: Ridge regression with degree-2 polynomial features trained on 10 circuits predicts a baseline lap time per track; XGBoost predicts the residual using per-lap features like tire stint, track position, compound, and fuel load.
- 02
Ridge regression chosen deliberately for Stage 1 — only 10 data points would make a tree model overfit.
- 03
Vectorized Monte Carlo engine in NumPy runs 10,000 simulations injecting model residuals and Gaussian noise.
- 04
WebSocket-driven live race state; chaos events (rain, safety cars) triggered from an iPad "steward" view ripple into new simulations instantly.
- 05
Gemini generates a 3-sentence radio call narrating outcomes — purely for presentation, no computation.
03 — Architecture
04 — Results
0.996
R² (5-fold CV)
0.35s
mean absolute error
<0.2s
for 10K simulations
Stack
Next
Tarmac→
iOS app that turns flight delays into spontaneous city itineraries, with an AI safety layer that never lets a bad plan reach the user.