A machine learning model and web application for predicting Formula 1 race podium finishers.
This project combines historical F1 data (2000-2024) from the Ergast API with recent telemetry data (2023-2025) from FastF1 to predict podium finishers for upcoming Grand Prix races. The system includes:
- Machine learning model for podium predictions
- Web application for viewing historical data and predictions
- MongoDB database for data storage
- RESTful API for data access
- Predicts top 3 finishers for upcoming races
- Considers driver performance history, track-specific performance, recent form, and team performance
- Uses neural networks for prediction
- View historical race data
- View detailed driver statistics
- View upcoming race information
- Display circuit maps and race details
-
Clone the repository
-
Create a virtual environment:
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install dependencies:
pip install -r requirements.txt
-
Set up environment variables:
- Create a
.envfile - Add your MongoDB Atlas connection string
- Add any API keys if needed
- Create a
-
Initialize the database:
python scripts/init_db.py
-
Run the web application:
python app.py
f1-model/
├── app/ # Web application
│ ├── static/ # Static files (CSS, JS, images)
│ ├── templates/ # HTML templates
│ └── routes/ # Flask routes
├── ml/ # Machine learning code
│ ├── data/ # Data processing scripts
│ ├── models/ # ML model definitions
│ └── training/ # Training scripts
├── scripts/ # Utility scripts
├── tests/ # Test files
├── .env # Environment variables
├── requirements.txt # Project dependencies
└── README.md # This file
- Historical Data (2000-2024): Ergast API
- Recent Data (2023-2025): FastF1 library
- Circuit Maps: F1 official website
- Additional Driver Information: Ergast API
Feel free to submit issues and enhancement requests!