time predictions view - VforVitorio/F1_Strat_Manager GitHub Wiki
Time Predictions View
- Overview
- System Architecture
- Installation and Setup
- Streamlit Dashboard
- Strategy Recommendations View
- Gap Analysis View
- Radio Analysis View
- Time Predictions View
- Strategy Chat Interface
- Machine Learning Models
- Lap Time Prediction
- Tire Degradation Modeling
- Vision-based Gap Calculation
- NLP Pipeline
- Radio Transcription
- Sentiment and Intent Analysis
- Named Entity Recognition
- Expert System
- Degradation Rules
- Gap Analysis Rules
- Radio Message Rules
- Integrated Rule Engine
- Developer Guide
- API Reference
- Integration Guide
Time Predictions View
- scripts/ML_tyre_pred/ML_utils/N00_model_lap_prediction.py
- scripts/ML_tyre_pred/N00_model_lap_prediction.ipynb
- scripts/app/components/competitive_analysis_view.py
- scripts/app/components/report_export.py
- scripts/app/components/time_predictions_view.py
- scripts/lap_prediction.ipynb
The Time Predictions View is a component of the F1 Strategy Manager that visualizes the comparison between predicted and actual lap times for selected drivers. This documentation explains how the view is implemented, its visual components, and its integration with the underlying prediction models.
For information about the lap time prediction model implementation, see Lap Time Prediction.
Purpose
This component allows race strategists to:
- Visualize predicted vs. actual lap times for any driver
- Evaluate prediction accuracy through error metrics
- Identify laps with significant prediction errors
- Understand performance trends to inform strategy decisions
Component Architecture
The Time Predictions View connects the lap time prediction model with the Streamlit dashboard interface, transforming prediction data into actionable visualizations.
Core Implementation
The component is implemented through the render_time_predictions_view
function, which generates three main visualization elements:
Visualization Components
The Time Predictions View generates three main visual elements:
1. Mean Absolute Error (MAE) Metric
A single numeric value that quantifies the overall prediction accuracy. Lower values indicate better prediction performance.
2. Top Errors Table
A tabular display showing the 5 laps with the largest prediction errors, helping identify specific problematic predictions.
Lap | Real Lap Time | Predicted Lap Time | Absolute Error |
---|---|---|---|
24 | 84.234 | 85.012 | 0.778 |
42 | 85.121 | 84.452 | 0.669 |
18 | 83.998 | 84.567 | 0.569 |
36 | 85.765 | 85.254 | 0.511 |
11 | 84.321 | 84.789 | 0.468 |
3. Comparison Chart
An interactive Plotly line chart that shows real and predicted lap times across all laps, enabling visual analysis of trends and patterns.
Data Requirements
For proper functioning, the Time Predictions View requires a DataFrame with the following columns:
Column | Description | Type |
---|---|---|
DriverNumber | Car number of the driver | integer |
LapNumber | Sequential lap number | integer |
LapTime | Actual recorded lap time | float (seconds) |
PredictedLapTime | Model-predicted lap time | float (seconds) |
The view automatically calculates the AbsError
column as the absolute difference between actual and predicted lap times.
Prediction Model Integration
The view displays predictions generated by the lap time prediction model. The prediction pipeline involves:
Key features used for prediction include:
- Tire compound and age
- Speed at various track segments
- Historical data from previous laps
- Sequential features capturing trends
Integration with Other Views
The Time Predictions View is part of the Streamlit dashboard and works alongside other components in the F1 Strategy Manager:
The prediction data can also be included in strategy reports via the report export functionality.
Practical Usage
When using the Time Predictions View:
- Select a driver from the dashboard
- The view automatically filters prediction data for that driver
- Review the MAE to assess overall prediction quality
- Examine the top errors table to identify specific problematic laps
- Analyze the comparison chart to detect patterns or trends in performance
- Use these insights to inform race strategy decisions
The view is particularly valuable for:
- Validating the prediction model's reliability
- Understanding how different race conditions affect performance
- Identifying unexpected performance changes that may require strategy adjustments
- Providing data-driven support for strategic decisions