F1 Prediction Dashboard is an interactive web app that predicts Formula 1 race outcomes using machine learning, real qualifying data, and live weather conditions.
-
Race Time Prediction: Uses an XGBoost regression model trained on historical qualifying and race data to predict median race lap times for each driver.
-
Live & Hypothetical Modes: Analyze real races (2023–2024) or generate hypothetical scenarios for the 2025 season with customizable weather and track conditions.
-
Weather Integration: Fetches live weather data via WeatherAPI to enhance prediction accuracy.
-
Data Visualization: Presents results and podium predictions with interactive Plotly charts.
-
User-Friendly Interface: Built with Streamlit for an intuitive, responsive dashboard experience.
The backend fetches and processes qualifying and race data using FastF1.
The model is trained and saved with train_and_save_model.py using features like sector times and weather.
The Streamlit app (streamlit_app.py) loads the model, collects user inputs, and displays predictions.
Here is a list of the main technologies used in your F1 Advanced Prediction Dashboard project:
-
Streamlit – for building the interactive web dashboard.
-
Pandas – for data manipulation and analysis.
-
NumPy – for numerical operations and random data -generation.
-
Joblib – for saving and loading the trained machine learning model.
-
Requests – for making HTTP requests to fetch live weather data.
-
FastF1 – for accessing and processing Formula 1 session data (qualifying, race, weather).
-
Plotly – for interactive data visualization within the dashboard.
-
XGBoost – as the core machine learning algorithm for race time prediction.
-
Scikit-learn – for model evaluation and data splitting (train/test split).
-
WeatherAPI – (via HTTP requests) for integrating live weather data into predictions
Clone the repository:
git clone https://github.com/aryannverse/Formula-1-Prediction-Model.gitInstall all the libraries mentioned in the 'Requirements.txt'
pip install -r Requirements.txtIn the 'Streamlit_app.py' file, insert your WeatherAPI key in line 76
params = {"key": "", "q": location} #insert your key here from http://api.weatherapi.comEnter this line in the terminal to launch the dashboard in your browser:
streamlit run 'streamlit_app.py'