{"id":32861808,"url":"https://github.com/aini9027/f1-analytics-portfolio","last_synced_at":"2026-04-11T17:41:07.905Z","repository":{"id":323063783,"uuid":"1091876055","full_name":"aini9027/f1-analytics-portfolio","owner":"aini9027","description":"Formula 1 Race Strategy Analytics — End-to-End Data Analytics Project (SQL, Python, Power BI)","archived":false,"fork":false,"pushed_at":"2025-11-07T21:02:10.000Z","size":13,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-11-07T22:24:44.432Z","etag":null,"topics":["dashboard","data-analytics","ergast","etl","fastf1","formula1","kaggle","portfolio-project","postgres","powerbi","python","sql","sqlite","streamlit","tableau","visualization"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aini9027.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-11-07T16:45:48.000Z","updated_at":"2025-11-07T21:02:14.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/aini9027/f1-analytics-portfolio","commit_stats":null,"previous_names":["aini9027/f1-analytics-portfolio"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/aini9027/f1-analytics-portfolio","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aini9027%2Ff1-analytics-portfolio","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aini9027%2Ff1-analytics-portfolio/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aini9027%2Ff1-analytics-portfolio/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aini9027%2Ff1-analytics-portfolio/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aini9027","download_url":"https://codeload.github.com/aini9027/f1-analytics-portfolio/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aini9027%2Ff1-analytics-portfolio/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":283424652,"owners_count":26833720,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-11-08T02:00:06.281Z","response_time":57,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dashboard","data-analytics","ergast","etl","fastf1","formula1","kaggle","portfolio-project","postgres","powerbi","python","sql","sqlite","streamlit","tableau","visualization"],"created_at":"2025-11-08T22:00:37.129Z","updated_at":"2026-04-11T17:41:07.898Z","avatar_url":"https://github.com/aini9027.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"assets/banner.png\" alt=\"F1 Race Strategy Analytics Banner\"\u003e\n\u003c/p\u003e\n\n# 🏎️ Formula 1 Race Strategy Analytics\n**End-to-End Data Analytics Project (SQL | Python | Power BI | Tableau | FastF1)**\n\n## 🎯 Project Goal\nAnalyze Formula 1 race, qualifying, and lap data to uncover **how driver performance, team strategies, and pit-stop timing influence race outcomes** — and present findings through **clean insights, visuals, and dashboards**.\n\n## 💡 Objectives\n- Clean, structure, and integrate multi-source F1 datasets (Ergast API, Kaggle CSVs, FastF1).\n- Perform SQL-based exploratory analysis on races, drivers, constructors, and circuits.\n- Visualize **driver consistency, qualifying vs. race performance, pit-stop strategy**, and telemetry insights.\n- Provide actionable insights for a “team principal” or strategist.\n- Deliver a professional analytics case study with code, queries, visuals, and reports.\n\n## 🧩 Key Questions Explored\n1. Which drivers and teams are most consistent across seasons?\n2. How strong is the correlation between qualifying and final race position?\n3. How much time is gained or lost through pit-stop strategy?\n4. Which circuits favor which teams or drivers?\n5. What is the impact of pitting under Safety Car vs. green flag conditions?\n\n## 🗂️ Project Structure\n\u003e All analysis code is available inside the `notebooks/` directory, with each step of the workflow clearly documented and reproducible.\n\n```\n\nf1-analytics-portfolio/\n│\n├─ data/                     # CSVs or API extracts (drivers, races, results, telemetry)\n├─ notebooks/\n│   ├─ 01_data_import_and_cleaning.ipynb\n│   ├─ 02_exploratory_analysis.ipynb\n│   ├─ 03_fastf1_silverstone_2023_analysis.ipynb\n│\n├─ sql/\n│   ├─ schema.sql\n│   ├─ queries.sql\n│\n├─ dashboard/\n│   ├─ power_bi/\n│   ├─ powerbi_layout.md\n│\n├─ reports/\n│   ├─ executive_summary.md\n│   ├─ slide_deck.pdf\n│\n├─ PROJECT_LOG.md\n├─ README.md\n└─ requirements.txt\n```\n\n## 🛠️ Tech Stack\n| Category | Tools / Libraries |\n|-----------|-------------------|\n| Data Ingestion | Python (pandas, requests), FastF1, Ergast API |\n| Database | SQLite (demo), PostgreSQL (future) |\n| Analysis | SQL, pandas, numpy |\n| Visualization | Power BI, Tableau, Matplotlib, Plotly |\n| Reporting | Markdown, PDF, PowerPoint |\n\n## 🔍 Data Sources\n- **Ergast API** — historical results, qualifying, pit stops, lap times  \n- **FastF1 Library** — timing, tyre, stint, and telemetry data  \n- **Kaggle Datasets** — precompiled CSVs for offline use\n\n### 📄 Processed Data (Generated)\n- `sector_deltas_ver_ham.csv`\n- `lap_deltas_ver_ham.csv`\n- `racecraft_laps_ver_ham.csv`\n- `racecraft_summary_ver_ham.csv`\n\n\n## 📓 Silverstone 2023 — Tyre \u0026 Stint Insights (VER vs HAM)\nThis project includes targeted analysis of the **2023 British Grand Prix (Silverstone)**, comparing **Max Verstappen (VER)** and **Lewis Hamilton (HAM)**.\n\n### 🔹 Tyre Compound Pace\n- Computed average \u0026 median lap times by tyre compound (Soft / Medium / Hard)\n- Visual comparison of compound performance for both drivers\n- VER showed superior average pace across tyre types\n\n### 🔹 Stint-Level Performance\n- Boxplots reveal lap-time distribution per stint\n- VER displayed lower variance → higher consistency\n- HAM exhibited greater fluctuation indicating tyre drop or traffic periods\n\n### 🔹 Why This Matters\n- Shows relative tyre management ability  \n- Helps quantify race pace consistency  \n- Forms the foundation for the upcoming **Driver Scouting Scorecard**\n\n## 📸 Sample Visuals from the Analysis\n\nBelow are selected visuals from the Silverstone 2023 (VER vs HAM) race analysis to demonstrate pace, strategy, and driver performance differences.\n\n### 🏁 Position Evolution — VER vs HAM (Silverstone 2023)\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"assets/position_evolution.png\" width=\"700\"\u003e\n\u003c/p\u003e\n\n### 🟦 Sector Delta Comparison (HAM – VER)\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"assets/sector_delta.png\" width=\"700\"\u003e\n\u003c/p\u003e\n\n### 🟥 Lap Time Delta (HAM – VER)\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"assets/lap_delta.png\" width=\"700\"\u003e\n\u003c/p\u003e\n\n### 🟨 Tyre Compound Pace (Average Lap Times)\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"assets/compound_pace.png\" width=\"700\"\u003e\n\u003c/p\u003e\n\n### 🟩 Stint Consistency Boxplots\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"assets/stint_boxplot.png\" width=\"700\"\u003e\n\u003c/p\u003e\n\n## 📡 Telemetry Insights – Silverstone 2023 (VER vs HAM)\n\nUsing FastF1 telemetry, the project compares **Max Verstappen and Lewis Hamilton** on a selected race lap at Silverstone 2023.\n\n### 🔹 Speed Trace Overlay\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"assets/telemetry_speed_trace_lap30.png\" width=\"700\"\u003e\n\u003c/p\u003e\n\n- Shows how VER and HAM differ in **corner entry, mid-corner, and exit speeds**.\n- Highlights where one driver is more confident on turn-in or maintains higher minimum speed.\n\n### 🔹 Speed Delta by Distance (HAM – VER)\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"assets/telemetry_speed_delta_lap30.png\" width=\"700\"\u003e\n\u003c/p\u003e\n\n- Positive delta ⇒ HAM faster at that point on track  \n- Negative delta ⇒ VER faster  \n- Allows **corner-by-corner performance comparison** and ties together:\n  - Car setup differences  \n  - Tyre state  \n  - Driving style  \n\nThese telemetry insights complement the lap/sector delta analysis and support a **driver scouting and race engineering perspective**, not just pure statistics.\n\n📡 How to Read F1 Telemetry Plots (Engineer-Level Guide)\n\nUnderstanding telemetry is essential in Formula 1 because it reveals where and why one driver is faster than another.\nThis project uses FastF1 telemetry data (speed, distance, sectors) to compare Max Verstappen (VER) and Lewis Hamilton (HAM) during the 2023 British Grand Prix.\n\nThis section explains how to interpret the telemetry plots included in this repository so that even non-technical readers can follow the engineering analysis.\n\n🏎️ 1. Speed Trace Overlay (Speed vs Distance)\n\nThe speed trace shows how a driver brakes, corners, and accelerates through the lap.\n\n\u003cp align=\"center\"\u003e \u003cimg src=\"assets/telemetry_speed_trace_lap30.png\" width=\"650\"\u003e \u003c/p\u003e\n🔍 What to look for\nA. Braking Zones (sharp downward slopes)\n\nA steep drop = hard or late braking\nA smooth drop = earlier or more controlled braking\n\nExample interpretation:\n\nIf HAM’s curve drops later → HAM brakes later / more aggressively\n\nIf VER’s drop is smoother → VER manages the entry more progressively\n\nB. Apex Speeds (lowest point in the curve)\n\nThis shows mid-corner grip and rotation.\n\nExample interpretation:\n\nIf VER’s minimum speeds are higher → VER carries more mid-corner speed\n\nIf HAM’s line sits higher at certain corners → Mercedes stronger in that section\n\nC. Corner Exit (where the curve rises after the apex)\n\nShows traction and throttle application.\n\nExample interpretation:\n\nVER’s trace rising earlier → better traction or earlier throttle\n\nHAM accelerating sooner → stronger exit grip or deployment\n\nD. Straights (flat or gently rising areas)\n\nPeak speeds indicate top-end performance.\n\nExample interpretation:\n\nHigher peak speed = lower drag / better ERS\n\nHAM faster on straights → Mercedes aero efficiency\n\nVER faster → Red Bull’s lower drag philosophy\n\n📉 2. Speed Delta Plot (HAM – VER)\n\u003cp align=\"center\"\u003e \u003cimg src=\"assets/telemetry_speed_delta_lap30.png\" width=\"650\"\u003e \u003c/p\u003e\n\nThe delta plot shows directly which driver is faster at each part of the track.\n\nPositive delta (above zero) → HAM faster\n\nNegative delta (below zero) → VER faster\n\n🔍 What patterns reveal\nA. Time Gain / Loss\n\nRising delta → HAM gaining\n\nFalling delta → VER gaining\n\nB. Corner Characteristics\n\nDeep dips at corner exits → VER traction advantage\n\nSharp spikes at braking zones → HAM braking confidence\n\nFlat positive regions → HAM straight-line advantage\n\nSustained negative regions → VER corner-to-corner momentum\n\n🧠 Why This Analysis Matters\n\nTelemetry reveals the exact reason behind lap time differences:\n\nWhere does each driver gain or lose time?\n\nIs the advantage from braking, apex speed, or traction?\n\nAre the differences caused by setup, driving style, or tyre condition?\n\nThis type of analysis mirrors how F1 teams evaluate:\n\nDriver performance\n\nCar balance\n\nSetup options\n\nStrategy decisions\n\nIncluding telemetry in your portfolio demonstrates race engineering-level analytical thinking, far beyond basic data visualization.\n\n📘 Coming Soon\n\nFuture telemetry enhancements planned for this project:\n\nCorner labels (Turn 1–18 overlays)\n\nThrottle \u0026 brake traces\n\nGear usage comparison\n\nERS deployment mapping\n\nDriver performance scoring framework\n\n## 🖥️ Deliverables\n- 🧮 Clean database (`data/f1.db`)  \n- 🗃️ SQL queries and analytical scripts  \n- 📓 Jupyter Notebooks (cleaning, EDA, FastF1 analysis)  \n- 📈 Power BI dashboard layout (`dashboard/powerbi_layout.md`)  \n- 🧾 Executive summary \u0026 slide deck  \n\n## 🔎 Exploratory Data Analysis (SQL-First)\n**Update — November 2025**\n\nThe SQL-focused notebook (`02_exploratory_analysis.ipynb`) includes:\n- Wins per driver  \n- Average points per driver  \n- Positions gained (grid vs finish)  \n- Pit-stop durations by team  \n- Grid vs finish correlation (Pearson \u0026 Spearman)  \n- Circuit performance summaries  \n- Clean, reproducible Matplotlib charts  \n\nThis demonstrates strong **SQL analytical thinking** and supports future dashboard integration.\n\n## 🧠 Example Insights\n\u003e - **Early pit-stop advantage**: Drivers pitting before lap 15 gained +0.7 positions on average.  \n\u003e - **Qualifying ↔ Race correlation**: r = 0.68 — grid position remains decisive.  \n\u003e - **Consistency outliers**: Midfield drivers occasionally show top-tier consistency across seasons.  \n\n## 🚀 How to Use\n```bash\ngit clone https://github.com/ammarhaider/f1-analytics-portfolio.git\ncd f1-analytics-portfolio\n```\n\n1. Place Kaggle/Ergast files into `/data`  \n2. Run the cleaning notebook  \n3. Load the database into SQLite/PostgreSQL  \n4. Run SQL queries  \n5. Open the Power BI / Tableau dashboard  \n\n## 📘 Latest Updates\n- Added interactive notebooks (Nov 2025)  \n- Added Silverstone FastF1 analysis  \n- Included example SQLite database  \n- Added Power BI layout brief\n  \n### 🆕 Update — Sector \u0026 Lap Delta Analysis Added (24 Nov 2025)\n\nThe project now includes detailed **sector-by-sector** and **lap delta** analysis for the 2023 British Grand Prix (Silverstone), comparing **Max Verstappen (VER)** and **Lewis Hamilton (HAM)**.\n\n**What’s new:**\n- Extracted and cleaned sector timing data (S1, S2, S3) using FastF1.\n- Computed per-lap sector deltas (HAM – VER) to show where each driver gained or lost time.\n- Built a full-race lap delta curve to visualize underlying race pace differences.\n- Added visualizations for sector deltas and lap deltas.\n- Exported outputs (`sector_deltas_ver_ham.csv`, `lap_deltas_ver_ham.csv`) for integration into SQL and Power BI.\n\n**Why it matters:**  \nThis analysis highlights *where* driver and car performance differs — high-speed sections, technical middle sector, braking zones, and traction exits.  \nThis forms the basis for upcoming telemetry overlays and the driver scoring model.\n\n\n---\n\n## 📄 Additional Documentation\n\n- 👉 **[ABOUT.md](ABOUT.md)**  \n  Detailed overview of the project structure, goals, analytics workflow, and long-term roadmap.\n\n- 👉 **[CONTRIBUTING.md](CONTRIBUTING.md)**  \n  Guidelines for setting up the environment, coding standards, naming conventions, and how to contribute to the project.\n\n- 👉 **[LICENSE](LICENSE)**  \n  MIT License — permissions, usage rights, and limitations for this project.\n\nFor a step-by-step build history, see:  \n- 👉 **[PROJECT_LOG.md](PROJECT_LOG.md)**\n\n---\n\n## 📅 Future Enhancements\n- Predictive modeling (finishing position regression)  \n- Weather \u0026 Safety Car race simulation  \n- Multi-season comparative dashboards  \n- Streamlit app for interactive analysis  \n\n## 👨‍💻 Author\n**Ammar Haider**  \nData Analytics Enthusiast | F1 Fan | Portfolio Builder\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faini9027%2Ff1-analytics-portfolio","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faini9027%2Ff1-analytics-portfolio","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faini9027%2Ff1-analytics-portfolio/lists"}