# roqaya25/f1-predictions architecture

> Architecture diagram of the GitHub repository roqaya25/f1-predictions, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-17). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/roqaya25/f1-predictions
- Repository: https://github.com/roqaya25/f1-predictions

## Overview

The product predicts a full 2026 F1 season: it obtains historical results, derives performance inputs, trains or applies a prediction model, simulates races, and aggregates championship standings. The README also describes an enhanced feature-engineering variant; it is shown as a separate capability, not as a proven runtime dependency of the main predictor. Some implementation details are omitted from the excerpts, so those links rely on the README’s stated workflow.

Main entry points: [`championship_predictor.py`](https://github.com/roqaya25/f1-predictions/blob/main/championship_predictor.py) (Race Data Collection), [`f1_enhanced.py`](https://github.com/roqaya25/f1-predictions/blob/main/f1_enhanced.py) (Multi-season Analysis)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_historical["Historical Data"]
  node_historical_results["Race Data Collection"]
  node_enhanced_data["Multi-season Analysis<br/>[f1_enhanced.py]"]
end

subgraph group_prediction["Prediction Models"]
  node_features["Performance Features<br/>[f1_enhanced.py]"]
  node_baseline_model["Baseline Model"]
  node_enhanced_model["Enhanced Model<br/>[f1_enhanced.py]"]
  node_exploration["Model Experiments<br/>[f1-1.py]"]
end

subgraph group_season["Season Simulation"]
  node_calendar["2026 Calendar"]
  node_race_sim["Race Simulation"]
  node_points["Race Points"]
end

subgraph group_results["Championship Results"]
  node_race_results["Season Results"]
  node_standings["Championship Standings"]
  node_report["Printed Report"]
end

node_user(("Analyst"))
node_fastf1{{"FastF1 API"}}

node_user -->|"runs predictor"| node_historical_results
node_historical_results -->|"loads race data"| node_fastf1
node_historical_results -->|"provides training data"| node_baseline_model
node_enhanced_data -->|"loads season data"| node_fastf1
node_enhanced_data -->|"derives metrics"| node_features
node_features -->|"provides model inputs"| node_enhanced_model
node_baseline_model -->|"predicts race outcomes"| node_race_sim
node_calendar -->|"sets races"| node_race_sim
node_race_sim -->|"ranks finishers"| node_points
node_points -->|"accumulates race results"| node_race_results
node_race_results -->|"aggregates points"| node_standings
node_standings -->|"prints standings"| node_report
node_report -->|"shows predictions"| node_user

click node_historical_results "https://github.com/roqaya25/f1-predictions/blob/main/championship_predictor.py"
click node_enhanced_data "https://github.com/roqaya25/f1-predictions/blob/main/f1_enhanced.py"
click node_features "https://github.com/roqaya25/f1-predictions/blob/main/f1_enhanced.py"
click node_baseline_model "https://github.com/roqaya25/f1-predictions/blob/main/championship_predictor.py"
click node_enhanced_model "https://github.com/roqaya25/f1-predictions/blob/main/f1_enhanced.py"
click node_calendar "https://github.com/roqaya25/f1-predictions/blob/main/championship_predictor.py"
click node_race_sim "https://github.com/roqaya25/f1-predictions/blob/main/championship_predictor.py"
click node_points "https://github.com/roqaya25/f1-predictions/blob/main/championship_predictor.py"
click node_race_results "https://github.com/roqaya25/f1-predictions/blob/main/championship_predictor.py"
click node_standings "https://github.com/roqaya25/f1-predictions/blob/main/championship_predictor.py"
click node_report "https://github.com/roqaya25/f1-predictions/blob/main/championship_predictor.py"
click node_exploration "https://github.com/roqaya25/f1-predictions/blob/main/f1-1.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_historical_results,node_enhanced_data toneBlue
class node_features,node_baseline_model,node_enhanced_model,node_exploration toneAmber
class node_calendar,node_race_sim,node_points,node_fastf1 toneMint
class node_race_results,node_standings,node_report toneRose
class node_user toneIndigo
```

## Components

### Historical Data

- [Race Data Collection](https://github.com/roqaya25/f1-predictions/blob/main/championship_predictor.py): `championship_predictor.py`
- [Multi-season Analysis](https://github.com/roqaya25/f1-predictions/blob/main/f1_enhanced.py): `f1_enhanced.py`

### Prediction Models

- [Performance Features](https://github.com/roqaya25/f1-predictions/blob/main/f1_enhanced.py): `f1_enhanced.py`
- [Baseline Model](https://github.com/roqaya25/f1-predictions/blob/main/championship_predictor.py): `championship_predictor.py`
- [Enhanced Model](https://github.com/roqaya25/f1-predictions/blob/main/f1_enhanced.py): `f1_enhanced.py`
- [Model Experiments](https://github.com/roqaya25/f1-predictions/blob/main/f1-1.py): `f1-1.py`

### Season Simulation

- [2026 Calendar](https://github.com/roqaya25/f1-predictions/blob/main/championship_predictor.py): `championship_predictor.py`
- [Race Simulation](https://github.com/roqaya25/f1-predictions/blob/main/championship_predictor.py): `championship_predictor.py`
- [Race Points](https://github.com/roqaya25/f1-predictions/blob/main/championship_predictor.py): `championship_predictor.py`

### Championship Results

- [Season Results](https://github.com/roqaya25/f1-predictions/blob/main/championship_predictor.py): `championship_predictor.py`
- [Championship Standings](https://github.com/roqaya25/f1-predictions/blob/main/championship_predictor.py): `championship_predictor.py`
- [Printed Report](https://github.com/roqaya25/f1-predictions/blob/main/championship_predictor.py): `championship_predictor.py`

### Other components

- **Analyst**
- **FastF1 API**

## Connections

- Analyst → Race Data Collection: runs predictor (evidence: `README.md`)
- Race Data Collection → FastF1 API: loads race data (evidence: `championship_predictor.py`)
- Race Data Collection → Baseline Model: provides training data (evidence: `README.md`)
- Multi-season Analysis → FastF1 API: loads season data (evidence: `f1_enhanced.py`)
- Multi-season Analysis → Performance Features: derives metrics (evidence: `f1_enhanced.py`)
- Performance Features → Enhanced Model: provides model inputs (evidence: `f1_enhanced.py`)
- Baseline Model → Race Simulation: predicts race outcomes (evidence: `README.md`)
- 2026 Calendar → Race Simulation: sets races (evidence: `championship_predictor.py`)
- Race Simulation → Race Points: ranks finishers (evidence: `championship_predictor.py`)
- Race Points → Season Results: accumulates race results (evidence: `README.md`)
- Season Results → Championship Standings: aggregates points (evidence: `championship_predictor.py`)
- Championship Standings → Printed Report: prints standings (evidence: `championship_predictor.py`)
- Printed Report → Analyst: shows predictions (evidence: `README.md`)
