Skip to content

Latest commit

 

History

17 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🏎️ DRS Data

F1 Telemetry & Race Prediction

A high-performance Machine Learning system for Formula 1® analysis, prediction, and race simulation.


Python FastF1 scikit-learn License: MIT Contributions Welcome


🧠 What is DRS Data?

DRS Data (Data Racing Strategies) is an end-to-end ML pipeline designed to model Formula 1 race weekends — from raw telemetry to race outcome prediction.

The system collects session data via FastF1, engineers domain-specific features, trains predictive models, simulates race scenarios, and explains performance using SHAP — all in a modular, extensible pipeline.


📊 Model Performance

Metric Value
🏎️ Qualifying MAE 2.18 – 2.88 positions
🏁 Race MAE ~2.5 positions
📈 R² Score up to 0.65

The model captures meaningful performance patterns despite the inherently stochastic nature of Formula 1 racing.


⚡ Features

Module Description
📈 Qualifying Prediction Predicts grid positions using session telemetry
🏁 Race Pace Analysis Models race-long pace and tire degradation
🔁 Race Simulation Simulates race scenarios lap by lap
🔍 SHAP Explainability Explains what drives each prediction
📊 Automated Reporting Generates JSON logs and Markdown summaries
⚙️ Modular Pipeline Clean flow: training → prediction → simulation

🏗️ Project Structure

drs_data/
├── src/
│   ├── data/               # Track context data
│   ├── training/           # Data collection, feature engineering, model training
│   ├── prediction/         # Qualifying and race predictions
│   ├── simulation/         # Race simulation engine and pace analysis
│   └── analysis/           # Model accuracy reporting
│
├── data/                   # Raw & processed datasets
├── models/                 # Trained models (.pkl)
├── cache/                  # FastF1 session cache
├── outputs_predictions/    # Generated prediction outputs
├── requirements.txt
└── README.md

🚀 Getting Started

1. Clone the repository

git clone https://github.com/palomacdev/drs_data
cd drs_data

2. Install dependencies

pip install -r requirements.txt

3. Collect & enrich data

⏳ First run may take a while — process data year by year for best results.

python src/training/collect_qualifying_data.py
python src/training/data_enrichment.py

4. Train the model

python src/training/train_quali_model.py

5. Run predictions

python src/prediction/predict_qualifying.py

📊 Model Reporting

Generate automated accuracy reports (JSON + Markdown):

python src/analysis/accuracy_report.py

🧪 Race Simulation

Simulate full race scenarios using trained models:

# Step 1 — run race pace analysis
python src/simulation/race_pace_overview.py

# Step 2 — run the race simulator
python src/simulation/race_simulator.py

🔮 Roadmap

  • Weather integration (rain probability, temperature, humidity)
  • Tire strategy modeling (compound, age, undercut windows)
  • Real-time prediction pipeline
  • REST API or Streamlit dashboard
  • Improved simulation realism (safety car, pit stops)

🤝 Contributing

Contributions are welcome — from bug fixes to new features and experiments!

Check CONTRIBUTING.md for branch conventions, guidelines, and ideas on where to start.


📄 License

Distributed under the MIT License.


Built by someone who loves both data and the sound of a V10. If you're into F1, ML, or both — this project is for you. 🏁

⭐ Star this repo if you find it useful!

About

A high-performance Machine Learning system for Formula 1® analysis, prediction, and race simulation.

Topics

Resources

Contributing

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages