FIA WEC · 2018–2019 Super Season

RACE
STRATEGY
ANALYSIS

An open-source Python package that ingests Al Kamel Systems timing data and runs a full ML pipeline across four car classes. The dashboard covers pace predictions, pit probability curves, SHAP feature importance, undercut analysis, and a strategy advisor built on association rules.

Spa-Francorchamps 2019 · Lap 142 Sample
Car Driver Lap time Gap
1 #8 Toyota TS050 2:02.131 −0.234
2 #7 Toyota TS050 2:02.365 +0.234
3 #22 United Autosports 2:07.812 +5.681
4 #37 Jackie Chan DC 2:08.441 +6.310
5 #91 Porsche GT Team 2:13.557 +11.426
6 #92 Porsche GT Team 2:13.891 +11.760
7 #85 Iron Lynx 2:15.202 +13.071
0 Laps analysed
0 Race weekends
0 Car entries
0 Tests passing

END-TO-END PIPELINE

From raw Al Kamel CSV to trained models in a single reproducible script. Every stage is tested and structured as an importable Python package.

01

Ingestion

Fetch & cache Al Kamel CSVs

02

Cleaning

Lap time parsing, in/out laps

03

Analysis

Outliers, traffic, stints

04

Features

Stint age, rolling pace, class delta

05

Training

GroupKFold CV + model persistence

pipeline.py — wec-analytics
raw = fetch_session(url)
cleaned = clean_session(raw)
flagged = detect_traffic_lap(detect_outliers(cleaned))
featured = build_lap_features(flagged)
model = train_pace_model(featured)

TWO MODELS,
TWO QUESTIONS

Both evaluated with leave-one-race-out GroupKFold cross-validation to prevent race-level data leakage.

PACE REGRESSION Regression
modelHistGradientBoostingRegressor
featuresstint_age · lap_number · car_class · deg_slope
targetdeviation from rolling pace
cv rmse1.98 s
PIT CLASSIFIER Classifier
modelHistGradientBoostingClassifier
featuresstint_age · rolling_pace · lap_number · car_class
targetis_in_lap (bool)
use casePit window probability curve

Leakage prevention

A module-level FORBIDDEN set blocks future-knowledge columns from entering the feature matrix. Validated at training time, not just documented.

GroupKFold by race

All laps from a given race stay in the same fold. Tests genuine generalisation to an unseen event, not interpolation within a race weekend.

Model persistence

Fitted pipelines saved with joblib alongside a JSON sidecar recording training sessions, CV scores, feature columns, and sklearn version.

SHAP explainability

TreeExplainer on both models. Global importance bar chart and a per-lap waterfall for the worst pace deviation or highest pit call in the session.

Undercut / Overcut

Detects the first strategic pit sequence between two cars, skips safety car stops, and classifies whether the undercut gained position.

Strategy Advisor

Describe the current race window and get a pit probability estimate from historical 15-min transactions, backed by association rule evidence.

EXPLORE THE DATA

Select a race, filter by class, and pick a car to explore pace residuals, pit probability, degradation, undercut analysis, and more.

UK · 2018

Silverstone

6 Hours

Japan · 2018

Fuji Speedway

6 Hours

China · 2018

Shanghai

6 Hours

USA · 2019

Sebring

8 Hours

Belgium · 2019

Spa-Franco­rchamps

6 Hours

France · 2019

Le Mans

24 Hours

UK · 2019

Silverstone

4 Hours

Japan · 2019

Fuji Speedway

6 Hours

China · 2019

Shanghai

4 Hours

Bahrain · 2019

Bahrain

8 Hours

USA · 2020

COTA

6 Hours

Belgium · 2020

Spa-Franco­rchamps

6 Hours

France · 2020

Le Mans

24 Hours

Bahrain · 2020

Bahrain

8 Hours

Open live demo →

Hosted on Render. Kept alive with UptimeRobot.