Welcome to the F1 Pit Strategy Predictor! This project analyzes historical Formula 1 data, engineers features like tire age and track conditions, and uses machine learning (Random Forest) to predict the optimal time to pit. It also integrates real-time telemetry using the fastf1 API.
Follow these steps to run the Jupyter Notebook on your own system.
You will need Python installed on your computer. You also need to install the required libraries. Open your terminal or command prompt and run the following command:
pip install pandas numpy matplotlib seaborn scikit-learn fastf1 notebookClone this repository to your local machine:
git clone https://github.com/Shane-dev29/F1_dmdw.git
cd F1_dmdwOnce you are inside the F1_dmdw folder in your terminal, start the Jupyter server by running:
jupyter notebook- Your web browser will open automatically.
- Click on
F1.ipynbto open the notebook. - At the top of the screen, click Cell -> Run All (or Run -> Run All Cells depending on your version) to execute the entire project from top to bottom.
F1.ipynb: The main notebook containing all the data cleaning, feature engineering, and machine learning models.app.py: A Streamlit dashboard application for visualizing the data.model.pkl: The pre-trained Random Forest model..csvfiles: All the historical Formula 1 datasets required for the project (races, drivers, pit stops, lap times, etc.).
Note: The first time you run the notebook, the fastf1 API will download telemetry data. This may take a moment, and it will create a local cache/ folder on your machine automatically to speed up future runs.