Multi-Season Formula 1 Lap Dataset with Race-Control-Based Safety Car Labels (2022-2025)
Description
Containing lap-level race data for the 2022-2025 Formula 1 seasons, the year-race-session data were collected using FastF1, public interface that provides access to timing and race information publicly available similarly on the web. Include only official race sessions! The data for each event were downloaded and then all of the events were merged into a single structured dataset. After eliminating invalid or incomplete laps and cleaning out missing values, the final dataset contains 89,980 driver lap observations. Each line represents one driver on one laps. The dataset includes such contextual and performance variables as lap number, race progression, tire compound, tire life, driver position, team ID, environmental variables including (air temperature, track temperature, humidity, rainfall) etc. We applied certain basic feature engineering processes in order to make the data model-friendly. Safety Car (SC) and Virtual Safety Car (VSC) labels were constructed by parsing official race control messages and aligning them with lap-level records. This makes it possible to model rare events at the level of the lap. The dataset also supports forward-looking targets (for instance, detection of a Safety Car within the next few laps) for probabilistic risk forecasting. The dataset's structure allows experiments with event-level validation. This means that entire Grand Prix events can be separated during training and testing to avoid leakage between laps in the same event. The data set is intended for academic research, it is a set of processing and structured derivative of public interface data FastF1 that was obtained via timing.
Files
Steps to reproduce
Race session data for the 2022–2025 Formula 1 seasons were downloaded using the FastF1 Python interface. For each Grand Prix event, lap timing data, weather variables, and race control messages were retrieved and stored as event-level Parquet files. These files were concatenated into a unified lap-level dataset, after which invalid or inaccurate laps were removed and relevant variables were converted to numeric format. Contextual features such as race progression and tyre-related indicators were engineered. Safety Car and Virtual Safety Car labels were constructed by parsing race control messages and aligning them to lap records. The resulting cleaned and labeled dataset was saved for downstream machine learning experiments, with optional event-grouped validation to avoid race-level leakage.