Explanation of the Division Calculation Algorithm
This algorithm is designed to fairly rank pilots by considering both their speed and the quality of their racing line, while also penalizing mistakes. Here’s how it works:
1. Event-Level Scoring
- Data Collection:
For each event, the performance data for each pilot is collected. This includes: - Lap Times: The duration of each lap (with faster times being better).
- Lap Distances: A measure of how closely a pilot follows the ideal line (with lower distances indicating a better line).
- Error Data: Information on missed gates.
- Normalization:
Since conditions can vary from one event to another, all lap times and distances are normalized across the event. - For Lap Time: The worst lap time is used as a reference so that a fast lap (i.e., a lower time) is given a high normalized score.
- For Lap Distance: Similarly, a lower distance (indicating a better line) receives a higher score.
- This normalization converts each raw value into a score between 0 and 1.
- Composite Lap Score:
Each lap is assigned a composite score by equally combining the normalized time and normalized distance scores.
The pilot’s event score is then calculated by averaging these composite scores across all their laps in the event. - Error Penalty:
The algorithm processes the missed gate data by: - Interpreting values that are either lists or comma-separated strings to count the number of missed gates.
- Subtracting a fixed penalty for each missed gate from the pilot’s average lap score.
- This adjustment ensures that mistakes lower the overall event score.
2. Division Assignment
- Aggregating Across Events:
The event scores for each pilot are aggregated by averaging the scores from all events they participated in. This provides an overall performance metric that smooths out anomalies from any single event. - Ranking and Grouping:
Pilots are then ranked in descending order based on their aggregated average scores.
The sorted list is divided into four groups: - Top 25%: Highest division.
- Next 25%: Second-highest division.
- Following 25%: Third division.
- Bottom 25%: Lowest division.
This percentile-based grouping ensures that the divisions are relative to the overall field performance.