Skip to content

Repository files navigation

🏎️ Formula 1 Performance Analytics & Race Outcome Prediction

Project Status

Tech Stack

Python Pandas NumPy Matplotlib Seaborn Scikit-Learn fastf1 Jupyter

Skills

Python Python Python Python Python Python Python

📌 Project Overview

This project explores historical Formula 1 Races Dataset to analyze driver performance, constructor dominance, overtaking patterns, and the impact of qualifying position on race outcomes.

Using multiple relational datasets containing race results, drivers, constructors, circuits, lap times, pit stops, and standings, the project demonstrates a complete data analytics workflow:

  • Data preprocessing
  • Exploratory data analysis
  • Statistical analysis
  • Predictive modeling

A machine learning model was also developed to estimate race-winning probability based on qualifying position.


🧠 Concepts Demonstrated

This project demonstrates multiple data analytics and machine learning concepts.

Data Analytics

  • Data Cleaning

  • Data Wrangling

  • Feature Engineering

  • Exploratory Data Analysis

  • Data Visualization

  • Trend Analysis

  • Sports Analytics

Machine Learning

  • Binary Classification

  • Logistic Regression

  • Random Forest

  • Model Evaluation

  • Predictive Modeling


📊 Data Description

The dataset contains historical Formula 1 race data (1950–Present).

Key Data Tables

circuits.csv

constructors.csv

constructor_standings.csv

drivers.csv

driver_standings.csv

lap_times.csv

pit_stops.csv

qualifying.csv

races.csv

results.csv

seasons.csv

status.csv

These relational datasets were merged and cleaned to create a master dataframe for analysis.


⚙️ Data Preprocessing

Key preprocessing steps included:

  • Merging multiple datasets using relational IDs:
  • Handling missing values
  • Converting data types
  • Removing inconsistent entries
  • Creating derived performance features

Additional engineered features:

  • is_winner

  • is_podium

  • position_change

  • win_rate

  • seasonal_points


📈 Exploratory Data Analysis (EDA)

Several exploratory analyses were conducted to understand Formula 1 performance patterns.

Constructor Dominance Over Time

A stacked area chart was used to visualize how top teams dominated different eras of Formula 1.

Driver Win Rate Comparison

Driver win rates were calculated as:

`Win Rate = Total Wins / Total Races

Driver Consistency Analysis

Driver consistency was analyzed by tracking seasonal points across multiple years.

Overtaking Analysis (Grid vs Finish Position)

A new metric was created:

Position Change = Grid Position − Race Finish Position

This metric highlights drivers with strong overtaking ability and racecraft.

Correlation Analysis

Correlation analysis was conducted between key variables:

  • Grid position

  • Qualifying position

  • Race finish

  • Points scored


🤖 Predictive Modeling

A binary classification model was built to predict race winners.

Target Variable

is_winner = 1 → Driver won the race is_winner = 0 → Driver did not win

Models Implemented

  • Logistic Regression

  • Random Forest Classifier

Model Workflow

  • Feature selection

  • Train-test split

  • Model training

  • Prediction

  • Model evaluation

Evaluation Metrics

Models were evaluated using:

  • Confusion Matrix

  • Accuracy

  • ROC-AUC Score

  • Classification Report

The results highlight the strong predictive importance of qualifying position.


🌐 Upcoming Full Stack Version

A full-stack version of this project with an interactive analytics dashboard will be developed soon.

About

This project uses Formula 1 data to analyze different aspects of the sport. the project applies data preprocessing, exploratory data analysis (EDA), statistical modeling, and machine learning techniques to uncover performance trends and build predictive models for race winners.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages