How aaronnn05/f1-apex-pace works
ApexPace predicts the next Formula 1 lap time from recent lap and tyre-state features. Its main workflow collects race laps, stores them in DuckDB, builds point-in-time features, then compares baselines and tunes an XGBoost model with temporal validation. The resulting model is saved and loaded by a FastAPI endpoint, which validates feature values and returns a prediction. The graph includes README-documented capabilities such as FastF1 ingestion and experiment tracking; links to unsampled subsystems rely on that documentation.
Main entry points: tune.py Model tuning · build_pipeline.py Ingest and build · main.py Prediction API · features_v1.parquet Processed features
Components 15
Data preparation
- Ingest and build
scripts/build_pipeline.py - Raw lap store
src/apex_pace/data/db.py - Feature engineering
src/apex_pace/features/pipeline.py - Processed features
data/processed/features_v1.parquet
Model experiments
- Baseline comparison
src/apex_pace/models/baseline.py - Temporal split
src/apex_pace/models/tune.py - Model tuning
src/apex_pace/models/tune.py - XGBoost training
src/apex_pace/models/tune.py - Optuna
- W&B tracking
- Tuned model
Prediction serving
- Prediction API
src/apex_pace/api/main.py - Lap-time result
src/apex_pace/api/main.py
Other components
- FastF1
- API client
Connections 15
- Ingest and build → FastF1: downloads laps
scripts/build_pipeline.py - Ingest and build → Raw lap store: writes laps
scripts/build_pipeline.py - Ingest and build → Feature engineering: builds features
scripts/build_pipeline.py - Ingest and build → Raw lap store: reads laps
scripts/build_pipeline.py - Feature engineering → Processed features: produces features
- Baseline comparison → Processed features: reads features
src/apex_pace/models/baseline.py - Temporal split → Processed features: reads features
src/apex_pace/models/tune.py - Temporal split → Model tuning: supplies splits
src/apex_pace/models/tune.py - Model tuning → Optuna: optimizes trials
src/apex_pace/models/tune.py - Model tuning → XGBoost training: trains model
src/apex_pace/models/tune.py - Model tuning → W&B tracking: logs results
src/apex_pace/models/tune.py - Model tuning → Tuned model: saves model
src/apex_pace/models/tune.py - API client → Prediction API: sends features
README.md - Tuned model → Prediction API: loads model
src/apex_pace/api/main.py - Prediction API → Lap-time result: returns prediction
src/apex_pace/api/main.py