mirror of
https://github.com/IAmTomShaw/f1-race-replay.git
synced 2026-05-09 08:25:56 +02:00
[PR #246] [CLOSED] feat: add live overtaking probability insight panel #248
Labels
No labels
bug
enhancement
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/f1-race-replay#248
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/IAmTomShaw/f1-race-replay/pull/246
Author: @pdf1802
Created: 3/11/2026
Status: ❌ Closed
Base:
main← Head:feature/data-analysis📝 Commits (10+)
f8f189eAdd tyre degradation analysis notebooke74fc85Delete analysis/notebooks directory2c44bd8Add analysis folder structureb9a406fAdd tyre degradation60c2895Add tyre degradation97c081aRename tyre_degradation.ipynb to tyre_degradation.ipynbf31d646Delete D:\Proyectos\f1-race-replay\analysis\notebooks\tyre_degradation.ipynbfa56ebdFirst tyre degadation graphic7c1cb51Add EDA visualizations and documentation9881d83Add lap time model notebook📊 Changes
11 files changed (+11154 additions, -5 deletions)
View changed files
➕
analysis/models/.gitkeep(+1 -0)➕
analysis/notebooks/.gitkeep(+1 -0)➕
analysis/notebooks/driver_style_fingerprinting.ipynb(+3446 -0)➕
analysis/notebooks/lap_time_model.ipynb(+3020 -0)➕
analysis/notebooks/overtaking_model.ipynb(+1851 -0)➕
analysis/notebooks/race_simulator.ipynb(+1573 -0)➕
analysis/notebooks/tyre_degradation.ipynb(+570 -0)📝
src/gui/insights_menu.py(+19 -0)➕
src/insights/overtaking_insight.py(+372 -0)📝
src/interfaces/race_replay.py(+32 -5)➕
src/overtaking_integrator.py(+269 -0)📄 Description
What this adds
A new pit wall insight panel — Overtaking Probability — under a new
"Race Analysis" category in the insights menu.
For each pair of adjacent cars within DRS range (~1.0s), displays a live
overtake probability bar from a trained XGBoost classifier.
How it works
Stream improvement
race_replay.py now augments the broadcast with compound and tyre_life
per driver from the existing degradation integrator. Insight panels
receive full tyre data without needing their own FastF1 session.
Model
XGBoost trained on FastF1 race data, 2023–2025 seasons.
Pattern
Follows TyreDegradationIntegrator throughout.
Setup — models required
The panel requires two model files that are not included in this repo
(binary files don't belong in git):
overtaking_model.pkl— XGBoost overtaking classifiercompound_map.json— compound name → integer encodingTo generate them: run
analysis/notebooks/overtaking_model.ipynbin Google Colab. The notebook trains and saves both files to
MyDrive/f1_models/automatically.To point the panel at your models, set the
F1_MODEL_DIRenvironment variable before launching:
export F1_MODEL_DIR=/path/to/your/models$env:F1_MODEL_DIR = "C:\path\to\your\models"Default path if not set:
./models🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.