Skip to content

biv720/F1KYC_KnowYourChamp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

8 Commits
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ F1KYC: KnowYourChamps

f1KYC Banner

A Formula 1 championship prediction and simulation engine powered by real-world data.

Maybe reality might be different xD

Python FastF1 Status License


๐Ÿ“Œ What is KYC?

KYC (KnowYourChamps) is a Python-based analytics project that predicts:

  • ๐Ÿ† World Drivers' Championship (WDC)
  • ๐ŸŽ๏ธ World Constructors' Championship (WCC)

using:

  • โœ… Real Formula 1 data
  • โœ… Monte Carlo simulations
  • โœ… Official FIA point systems
  • โœ… Season-aware rules
  • โœ… (Optional) live race updates

The goal is to model how championships evolve, not just display standings.


๐ŸŽ๏ธ Formula 1 โ€” Explained Simply

๐Ÿ“– New to F1? Check out our detailed guide: How F1 Scores

๐Ÿง Driver

A driver competes in races and earns points based on finishing position. Drivers compete for the World Drivers' Championship (WDC).

๐Ÿ‘‰ Example: Max Verstappen

๐ŸŽ๏ธ Constructor

A constructor (team) fields two drivers.

  • Team points = sum of both drivers' points
  • Competes for World Constructors' Championship (WCC)

๐Ÿ‘‰ Example: Red Bull Racing

๐Ÿ Race Weekend Types

Type Description
Race Main event (25โ€“1 points)
Sprint Short race (8โ€“1 points)
Fastest Lap +1 point (removed from 2025)

๐Ÿง  Championship Logic

  • โœ” One race affects both WDC and WCC
  • โœ” Sprint and Race handled separately
  • โœ” Rules vary by season
  • โœ” Simulation respects FIA scoring system

๐Ÿ”ฅ What KYC Does

โœ… Current Features

  • Build season state from real F1 data
  • Simulate remaining races using Monte Carlo
  • Predict:
    • WDC winner probability
    • WCC winner probability
  • Supports:
    • Sprint weekends
    • Rule changes by season
    • Future-proof architecture

๐Ÿงช Simulation Engine

  • Weighted randomness (based on current form)
  • Thousands of season simulations
  • Probabilistic outcome modeling
  • No hardcoded results

๐Ÿงฐ Tech Stack

๐Ÿง  Core

  • Python 3.10+
  • Dataclasses
  • OOP-based domain modeling

๐Ÿ“Š Data Source

  • FastF1 โ†’ Official Formula 1 timing & standings

๐Ÿงฎ Computation

  • NumPy
  • Monte Carlo Simulation
  • Probabilistic ranking

๐Ÿงฑ Architecture

  • Modular design
  • Clean separation of concerns
  • No tight coupling
  • Simulation-ready

๐Ÿ“ Project Structure

F1KYC/
โ”‚
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ models.py          # Core domain models
โ”‚   โ”œโ”€โ”€ simulation.py      # Monte Carlo engine
โ”‚   โ”œโ”€โ”€ data_fetching.py   # FastF1 integration
โ”‚   โ””โ”€โ”€ newwww.py          # Runner / entry point
โ”‚
โ”œโ”€โ”€ cache/                 # FastF1 cache
โ”œโ”€โ”€ howf1scores.md         # F1 scoring system explained
โ”œโ”€โ”€ README.md              # This file
โ””โ”€โ”€ requirements.txt       # Dependencies

โš™๏ธ How It Works

Step 1 โ€” Load Real Data

season = build_season_state(2025)

Step 2 โ€” Run Simulations

results = monte_carlo_championship(season, simulations=3000)

Step 3 โ€” Get Predictions

WDC:
VER โ†’ 71.2%
NOR โ†’ 18.4%
LEC โ†’ 7.1%

WCC:
Red Bull โ†’ 65.9%
McLaren โ†’ 29.3%

๐Ÿš€ Getting Started

Prerequisites

  • Python 3.10 or higher
  • pip package manager

Installation

  1. Clone the repository

    git clone https://github.com/biv720/kyc.git
    cd kyc
  2. Install dependencies

    pip install -r requirements.txt
  3. Run the simulation

    python src/newwww.py

Example Usage

from src.data_fetching import build_season_state
from src.simulation import monte_carlo_championship

# Load current season
season = build_season_state(2025)

# Run 5000 simulations
results = monte_carlo_championship(season, simulations=5000)

# View predictions
print(results)

๐Ÿง  Design Philosophy

Principle Description
โœ” Domain-first modeling Models reflect real F1 structure
โœ” No hardcoded logic Rules driven by season data
โœ” Rules driven by season Adapts to FIA regulation changes
โœ” Extendable for live data Ready for real-time integration
โœ” Clean separation Data & logic are independent

This project was built to scale into:

  • ๐Ÿ“ก Live race analysis
  • ๐ŸŽฏ Strategy simulations
  • ๐Ÿ“Š Data visualization dashboards
  • ๐Ÿ•ฐ๏ธ Historical season replay

๐Ÿš€ Future Roadmap

๐Ÿ”œ Coming Next

  • ๐ŸŸข Live Race Mode (real-time WDC/WCC updates)
  • ๐Ÿ“Š Streamlit Dashboard (interactive visualization)
  • ๐Ÿงช Unit test suite (comprehensive testing)
  • ๐ŸŒ Multi-season comparison (historical analysis)
  • ๐Ÿง  ML-based driver performance weighting (intelligent predictions)
  • ๐Ÿ“ˆ Strategy optimizer (pit stop & tire strategy)
  • ๐ŸŽฎ "What-if" scenario simulator (alternative outcomes)
  • ๐ŸŒ Web API (REST endpoints for predictions)

๐Ÿ“ธ Screenshots

Coming soon: Dashboard previews, simulation outputs, and prediction visualizations


๐Ÿค Contributing

Contributions are welcome! Whether it's bug fixes, new features, or documentation improvements.

  1. Fork the project
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

โš ๏ธ Disclaimer

This project is for educational and analytical purposes only.

Formula 1 is unpredictable โ€” weather, strategy, penalties, and chaos always apply.

Maybe reality might be different xD ๐ŸŽ๏ธ๐Ÿ’จ

The predictions are probabilistic models based on historical data and simulations, not guarantees of actual race outcomes.


๐Ÿ“ License

This project is licensed under the MIT License - see the LICENSE file for details.


๐Ÿ‘ค Author

Bivraj โ€” F1 Enthusiast | Data & Design

GitHub Twitter


๐Ÿ”— Resources


Built with ๐Ÿ for F1 data nerds and championship dreamers

โญ Star this repo | ๐Ÿ› Report Bug | โœจ Request Feature

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors