mirror of
https://github.com/soconnor0919/f1-race-prediction.git
synced 2026-02-05 00:06:39 -05:00
2.4 KiB
2.4 KiB
Formula One Lap Time Prediction
Project Overview
This project analyzes Formula One race data to predict lap times based on weather conditions, track characteristics, and other race-specific variables. Using machine learning models, we achieved significant success in predicting lap times across different tracks and conditions.
Video Presentation
Our video presentation can be found here.
Key Findings
- LightGBM model achieved the best overall performance (R² = 0.806, RMSE = 3.663)
- Weather conditions explain up to 80% of lap time variation
- Track-specific characteristics significantly impact model performance
- Best performance on Mexico City GP (R² = 0.899) and Belgian GP (R² = 0.845)
Data Source
Data was obtained from the FastF1 API, which provides:
- Detailed lap timing data
- Weather conditions
- Track information
- Tire compound data Link: FastF1 Documentation
Required Packages
dependencies:
- python=3.10
- pandas
- numpy
- matplotlib
- seaborn
- scikit-learn
- xgboost
- lightgbm
- fastf1
- jupyter
Project Structure
DataPrep_EDA.ipynb: Data preparation and exploratory analysisModeling.ipynb: Model development and evaluationFinal_Report.ipynb: Comprehensive analysis and findingsdata/: Directory containing cached race dataconda_env.yml: Conda environment specification
Models Used
- LightGBM (Best performer)
- XGBoost
- Random Forest
- Gradient Boosting
Key Features
- Track temperature and air temperature interaction
- Weather complexity score
- Tire degradation metrics
- Track evolution throughout races
Performance Metrics
Average metrics across all tracks:
Model RMSE R² MAE
Gradient Boosting 4.259 0.726 2.083
LightGBM 3.663 0.806 1.839
Random Forest 4.915 0.644 2.396
XGBoost 4.333 0.717 2.122
Setup Instructions
- Clone the repository
- Create conda environment:
conda env create -f conda_env.yml - Activate environment:
conda activate csci349 - Launch Jupyter:
jupyter notebook
Authors
- Sean O'Connor
- Connor Coles
Course Information
- Course: CSCI 349 - Introduction to Data Mining
- Semester: Fall 2024
- Instructor: Brian King
License
This project is part of academic coursework and is not licensed for commercial use.