Skip to content

sucharithag18/formula1-predictive-analytics-platform

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🏎️ Formula 1 Predictive Analytics & Race Intelligence Platform


🚀 Building an End-to-End Formula 1 Analytics and Prediction Platform

This project is a complete Formula 1 analytics and race outcome prediction platform designed to simulate a modern sports intelligence workflow using data engineering, machine learning, and business intelligence.

The platform ingests historical Formula 1 race data from the Ergast API, transforms it into analytical feature marts using dbt, trains machine learning models using XGBoost, and delivers insights through Power BI and Tableau dashboards.

The project demonstrates how predictive analytics pipelines can be built end-to-end using modern data engineering and machine learning workflows.


🎯 Why This Project Matters

Modern sports analytics organizations rely heavily on data-driven insights for:

  • Driver performance analysis
  • Race outcome prediction
  • Team strategy optimization
  • Performance benchmarking
  • Historical trend analysis
  • Fan engagement analytics

Traditional static reporting systems cannot efficiently support large-scale predictive workflows or advanced feature engineering pipelines.

This project demonstrates how modern analytics systems can:

  • Automate data ingestion workflows
  • Build reusable analytical data marts
  • Train predictive machine learning models
  • Generate race outcome predictions
  • Support interactive BI dashboards
  • Create scalable analytics pipelines

📊 Project Snapshot

  • Domain: Formula 1 Racing Analytics
  • Data Source: Ergast API
  • Database: PostgreSQL
  • Transformation Framework: dbt
  • Machine Learning: XGBoost
  • Workflow Orchestration: Airflow (Optional)
  • Visualization: Power BI and Tableau
  • Core Objective: Race Outcome Prediction and Analytics
  • Prediction Target: Top-10 Finishing Prediction

🏗️ System Architecture

Ergast ingestion
        ↓
Postgres warehouse
        ↓
dbt feature marts
        ↓
Feature engineering
        ↓
XGBoost models
        ↓
Prediction scoring
        ↓
Power BI / Tableau dashboards

⚙️ Core Features

1. Automated Formula 1 Data Ingestion

  • Pulls historical Formula 1 race data from the Ergast API
  • Loads structured race data into PostgreSQL
  • Supports multi-season ingestion workflows

2. PostgreSQL Analytical Warehouse

  • Stores raw and transformed racing datasets
  • Supports scalable analytics queries
  • Centralized warehouse for modeling and reporting

3. dbt Feature Engineering Pipeline

  • Builds reusable analytical feature marts
  • Creates race-level and driver-level analytical features
  • Supports modular transformation workflows

4. Machine Learning Prediction Pipeline

  • Uses XGBoost models for race outcome prediction
  • Predicts Top-10 driver finishes
  • Supports training and scoring workflows

5. Predictive Analytics Workflow

  • Generates race predictions by season and round
  • Evaluates model performance using calibration metrics
  • Supports repeatable prediction workflows

6. Business Intelligence Dashboards

  • Power BI and Tableau dashboards for race analytics
  • Visualizes driver trends and prediction outputs
  • Supports interactive business reporting

7. Workflow Orchestration

  • Optional Airflow orchestration support
  • Automates ingestion and transformation workflows
  • Simulates production-style analytics pipelines

✨ Key Highlights

  • End-to-end Formula 1 analytics and prediction pipeline
  • Ergast ingestion → Postgres → dbt → XGBoost → BI workflow
  • Dimensional marts and reusable analytical datasets
  • Realistic KPIs and calibration metrics
  • Interactive Power BI and Tableau dashboards
  • Easy extensibility for safety car and pit strategy simulations
  • Modular data engineering and ML architecture

🔥 What Makes This Project Different

Dimension Traditional Sports Dashboard This Project
Data Source Static exports Automated Ergast ingestion
Data Pipeline Manual preparation End-to-end automated workflow
Modeling Basic statistics XGBoost predictive modeling
Transformation Flat tables dbt feature marts
Analytics Historical reporting Predictive analytics
Visualization Static dashboards Interactive BI dashboards
Workflow Standalone analysis Integrated data engineering pipeline

🧠 Tech Stack

  • Python
  • PostgreSQL
  • dbt
  • XGBoost
  • Apache Airflow
  • Power BI
  • Tableau
  • Docker
  • SQL

📂 Repository Structure

formula1-predictive-analytics-platform/
│
├── README.md
├── requirements.txt
├── schema.sql
├── docker-compose.yml
├── .env.example
│
├── airflow_dags/
│   ├── f1_daily_ingest.py
│   └── f1_weekend_train_predict.py
│
├── bi/
│   ├── dashboard_wireframes.md
│   └── powerbi_measures.md
│
├── dbt/
│   ├── dbt_project.yml
│   ├── profiles.yml.example
│   └── models/
│       ├── staging/
│       └── marts/
│
├── notebooks/
│   ├── 01_eda.ipynb
│   └── 02_feature_checks.ipynb
│
└── src/
    ├── ingest/
    │   └── ergast_pull.py
    ├── features/
    │   └── build_pre_race_features.py
    ├── models/
    │   ├── train.py
    │   └── predict.py
    └── utils/
        └── io.py

▶️ How to Run

1. Configure Environment

Update the .env file with your database credentials and environment settings.

2. Start PostgreSQL

docker compose up -d

3. Create Database Schema

psql -f schema.sql

4. Install Dependencies

pip install -r requirements.txt

5. Run Ergast Data Ingestion

python src/ingest/ergast_pull.py --from-season 2014 --to-season 2024

6. Build dbt Models

cd dbt && dbt build

7. Train Prediction Model

python src/models/train.py --target top10

8. Generate Predictions

python src/models/predict.py --target top10 --season 2024 --round all

9. Explore BI Dashboards

Connect Power BI or Tableau to PostgreSQL and explore:

marts.f_predictions

📊 Machine Learning Workflow

Data Pipeline

  • Historical race ingestion
  • Feature engineering using dbt
  • Structured training datasets

Model Training

  • XGBoost classification models
  • Driver finish prediction
  • Top-10 race outcome prediction

Prediction Workflow

  • Season-based predictions
  • Round-level scoring
  • Model evaluation and calibration

📈 Key Analytics Capabilities

  • Driver performance tracking
  • Team comparison analysis
  • Historical race trend analysis
  • Prediction confidence analysis
  • Season-level benchmarking
  • Top-10 finish prediction
  • Operational analytics dashboards

💼 Business Impact

  • Demonstrates production-style analytics engineering workflows
  • Reduces manual data preparation effort
  • Supports scalable sports analytics pipelines
  • Enables data-driven race analysis
  • Combines BI, ML, and data engineering into one platform
  • Simulates real-world predictive analytics systems

🛠️ Skills Demonstrated

  • Data Engineering
  • ETL Pipelines
  • PostgreSQL
  • dbt
  • Machine Learning
  • XGBoost
  • Predictive Analytics
  • Business Intelligence
  • Airflow
  • Docker
  • SQL
  • Sports Analytics

⚠️ Limitations

  • Prediction quality depends on historical race data
  • External race conditions are not fully modeled
  • Real-time telemetry data is not included
  • Airflow orchestration is optional and may require additional setup

🔮 Future Improvements

  • Add real-time telemetry ingestion
  • Deploy dashboards to cloud infrastructure
  • Add deep learning race simulations
  • Integrate weather and pit strategy data
  • Add driver similarity and ranking models
  • Build live race prediction APIs
  • Add automated model retraining workflows

📄 License

MIT License


👨‍💻 Author

Built by Sucharitha Reddy Gaddam


✅ Conclusion

This project demonstrates how modern data engineering, machine learning, and business intelligence workflows can be integrated into a complete Formula 1 analytics platform.

By combining Ergast ingestion, PostgreSQL warehousing, dbt transformations, XGBoost prediction pipelines, and BI dashboards, the project provides a practical example of end-to-end predictive analytics system design.

The implementation highlights strong capabilities in ETL engineering, feature engineering, ML modeling, SQL analytics, and production-style analytics architecture.

About

End-to-end Formula 1 analytics and race prediction platform using PostgreSQL, dbt, XGBoost, Airflow, and BI dashboards for predictive sports intelligence.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Contributors