{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Formula One Project: Final Report\n", "\n", "DUE: December 10th, 2024 (Tue) \n", "Name(s): Sean O'Connor, Connor Coles \n", "Class: CSCI 349 - Intro to Data Mining \n", "Semester: Fall 2024 \n", "Instructor: Brian King " ] }, { "cell_type": "code", "execution_count": 56, "metadata": { "ExecuteTime": { "end_time": "2024-12-10T18:38:06.152974Z", "start_time": "2024-12-10T18:38:06.139745Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Python version: 3.10.13 (main, Sep 11 2023, 08:24:56) [Clang 14.0.6 ]\n", "Pandas version: 2.2.2\n", "Numpy version: 1.23.5\n", "Matplotlib version: 3.8.4\n", "Seaborn version: 0.13.2\n", "FastF1 version: 3.4.4\n", "Scikit-learn version: 1.5.1\n", "XGBoost version: 2.1.1\n", "LightGBM version: 4.5.0\n" ] } ], "source": [ "# Importing Libraries\n", "import sys\n", "import pandas as pd\n", "import numpy as np\n", "import seaborn as sns\n", "import random\n", "import os\n", "\n", "import fastf1\n", "import fastf1.plotting\n", "from fastf1.ergast.structure import FastestLap\n", "\n", "import matplotlib.pyplot as plt\n", "import matplotlib as mpl\n", "from matplotlib.collections import LineCollection\n", "\n", "from sklearn.preprocessing import StandardScaler\n", "from sklearn.ensemble import RandomForestRegressor\n", "from sklearn.metrics import mean_squared_error, r2_score\n", "from sklearn.ensemble import GradientBoostingRegressor\n", "import xgboost as xgb\n", "from sklearn.model_selection import train_test_split, GridSearchCV\n", "from sklearn.pipeline import Pipeline, make_pipeline\n", "from sklearn.impute import SimpleImputer\n", "from sklearn.metrics import mean_absolute_error\n", "\n", "from xgboost import XGBRegressor\n", "from lightgbm import LGBMRegressor\n", " \n", "#print versions of libraries\n", "print(f'Python version: {sys.version}')\n", "print(f'Pandas version: {pd.__version__}')\n", "print(f'Numpy version: {np.__version__}')\n", "print(f'Matplotlib version: {plt.matplotlib.__version__}')\n", "print(f'Seaborn version: {sns.__version__}')\n", "print(f'FastF1 version: {fastf1.__version__}')\n", "print(f'Scikit-learn version: {sys.modules[\"sklearn\"].__version__}')\n", "print(f'XGBoost version: {xgb.__version__}')\n", "print(f'LightGBM version: {sys.modules[\"lightgbm\"].__version__}')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Problem Statement\n", "We are analyzing Formula One driver performance to understand and predict race outcomes based on various conditions. Specifically, we aim to:\n", "1. Predict lap times based on weather and track conditions\n", "2. Understand how different variables affect driver performance\n", "3. Create models that can forecast race performance\n", "\n", "This is primarily a regression problem, as we're predicting continuous values (lap times) based on multiple features." ] }, { "cell_type": "code", "execution_count": 18, "metadata": { "ExecuteTime": { "end_time": "2024-12-10T17:42:22.557629Z", "start_time": "2024-12-10T17:42:22.532022Z" } }, "outputs": [], "source": [ "# Set up FastF1 plotting and caching\n", "cache_dir = '../data/cache'\n", "if not os.path.exists(cache_dir):\n", " os.makedirs(cache_dir)\n", "\n", "fastf1.Cache.enable_cache(cache_dir)\n", "fastf1.plotting.setup_mpl(misc_mpl_mods=False, color_scheme=None)" ] }, { "cell_type": "code", "execution_count": 19, "metadata": { "ExecuteTime": { "end_time": "2024-12-10T17:42:23.135727Z", "start_time": "2024-12-10T17:42:23.132572Z" } }, "outputs": [], "source": [ "# Define years, sessions, and events of interest\n", "years = [2021, 2022, 2023, 2024]\n", "sessions = ['Race']\n", "events = ['Bahrain Grand Prix', 'Saudi Arabian Grand Prix', 'Dutch Grand Prix', 'Italian Grand Prix', 'Austrian Grand Prix', 'Hungarian Grand Prix', 'British Grand Prix', 'Belgian Grand Prix', 'United States Grand Prix', 'Mexico City Grand Prix', 'Sao Paulo Grand Prix']" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Why these events, sessions, and years?\n", "\n", "These events were chosen because they are all currently scheduled for the 2024 season, as well as having occurred in previous years. \n", "\n", "Each event has a specific set of conditions that may affect driver performance:\n", "- Bahrain: Hot and humid, with high track temperatures\n", "- British: Cool and changeable, with frequent rain\n", "- Belgian: Overcast and cool, with frequent weather changes\n", "- United States: Very hot, with high track temperatures\n", "- Mexico City: Cool and changeable, with frequent rain\n", "\n", "As for years, we chose 2021 to 2024 because they are the most recent years for which data is available. In 2021, the regulations changed to allow for more overtaking, so the lap times became incomparable to that of previous years.\n", "\n", "We chose to only use the 'Race' session because it is the most representative of a race condition, as opposed to qualifying, which can be very sporadic." ] }, { "cell_type": "code", "execution_count": 20, "metadata": { "ExecuteTime": { "end_time": "2024-12-10T17:45:57.601953Z", "start_time": "2024-12-10T17:42:24.338445Z" } }, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "core INFO \tLoading data for Bahrain Grand Prix - Race [v3.4.4]\n", "req INFO \tUsing cached data for session_info\n", "req INFO \tUsing cached data for driver_info\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "Processing 2021 Bahrain Grand Prix - Race\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "req INFO \tUsing cached data for session_status_data\n", "req INFO \tUsing cached data for lap_count\n", "req INFO \tUsing cached data for track_status_data\n", "req INFO \tUsing cached data for _extended_timing_data\n", "req INFO \tUsing cached data for timing_app_data\n", "core INFO \tProcessing timing data...\n", "req INFO \tUsing cached data for car_data\n", "req INFO \tUsing cached data for position_data\n", "req INFO \tUsing cached data for weather_data\n", "req INFO \tUsing cached data for race_control_messages\n", "core INFO \tFinished loading data for 20 drivers: ['44', '33', '77', '4', '11', '16', '3', '55', '22', '18', '7', '99', '31', '63', '5', '47', '10', '6', '14', '9']\n", "core INFO \tLoading data for Saudi Arabian Grand Prix - Race [v3.4.4]\n", "req INFO \tUsing cached data for session_info\n", "req INFO \tUsing cached data for driver_info\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "Processing 2021 Saudi Arabian Grand Prix - Race\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "req INFO \tUsing cached data for session_status_data\n", "req INFO \tUsing cached data for lap_count\n", "req INFO \tUsing cached data for track_status_data\n", "req INFO \tUsing cached data for _extended_timing_data\n", "req INFO \tUsing cached data for timing_app_data\n", "core INFO \tProcessing timing data...\n", "req INFO \tUsing cached data for car_data\n", "req INFO \tUsing cached data for position_data\n", "req INFO \tUsing cached data for weather_data\n", "req INFO \tUsing cached data for race_control_messages\n", "core INFO \tFinished loading data for 20 drivers: ['44', '33', '77', '31', '3', '10', '16', '55', '99', '4', '18', '6', '14', '22', '7', '5', '11', '9', '63', '47']\n", "core INFO \tLoading data for Dutch Grand Prix - Race [v3.4.4]\n", "req INFO \tUsing cached data for session_info\n", "req INFO \tUsing cached data for driver_info\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "Processing 2021 Dutch Grand Prix - Race\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "req INFO \tUsing cached data for session_status_data\n", "req INFO \tUsing cached data for lap_count\n", "req INFO \tUsing cached data for track_status_data\n", "req INFO \tUsing cached data for _extended_timing_data\n", "req INFO \tUsing cached data for timing_app_data\n", "core INFO \tProcessing timing data...\n", "req INFO \tUsing cached data for car_data\n", "req INFO \tUsing cached data for position_data\n", "req INFO \tUsing cached data for weather_data\n", "req INFO \tUsing cached data for race_control_messages\n", "core INFO \tFinished loading data for 20 drivers: ['33', '44', '77', '10', '16', '14', '55', '11', '31', '4', '3', '18', '5', '99', '88', '6', '63', '47', '22', '9']\n", "core INFO \tLoading data for Italian Grand Prix - Race [v3.4.4]\n", "req INFO \tUsing cached data for session_info\n", "req INFO \tUsing cached data for driver_info\n", "req INFO \tUsing cached data for session_status_data\n", "req INFO \tUsing cached data for lap_count\n", "req INFO \tUsing cached data for track_status_data\n", "req INFO \tUsing cached data for _extended_timing_data\n", "req INFO \tUsing cached data for timing_app_data\n", "core INFO \tProcessing timing data...\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "Processing 2021 Italian Grand Prix - Race\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "req INFO \tUsing cached data for car_data\n", "req INFO \tUsing cached data for position_data\n", "req INFO \tUsing cached data for weather_data\n", "req INFO \tUsing cached data for race_control_messages\n", "core INFO \tFinished loading data for 20 drivers: ['3', '4', '77', '16', '11', '55', '18', '14', '63', '31', '6', '5', '99', '88', '47', '9', '44', '33', '10', '22']\n", "core INFO \tLoading data for Austrian Grand Prix - Race [v3.4.4]\n", "req INFO \tUsing cached data for session_info\n", "req INFO \tUsing cached data for driver_info\n", "req INFO \tUsing cached data for session_status_data\n", "req INFO \tUsing cached data for lap_count\n", "req INFO \tUsing cached data for track_status_data\n", "req INFO \tUsing cached data for _extended_timing_data\n", "req INFO \tUsing cached data for timing_app_data\n", "core INFO \tProcessing timing data...\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "Processing 2021 Austrian Grand Prix - Race\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "req INFO \tUsing cached data for car_data\n", "req INFO \tUsing cached data for position_data\n", "req INFO \tUsing cached data for weather_data\n", "req INFO \tUsing cached data for race_control_messages\n", "core INFO \tFinished loading data for 20 drivers: ['33', '77', '4', '44', '55', '11', '3', '16', '10', '14', '63', '22', '18', '99', '7', '6', '5', '47', '9', '31']\n", "core INFO \tLoading data for Hungarian Grand Prix - Race [v3.4.4]\n", "req INFO \tUsing cached data for session_info\n", "req INFO \tUsing cached data for driver_info\n", "req INFO \tUsing cached data for session_status_data\n", "req INFO \tUsing cached data for lap_count\n", "req INFO \tUsing cached data for track_status_data\n", "req INFO \tUsing cached data for _extended_timing_data\n", "req INFO \tUsing cached data for timing_app_data\n", "core INFO \tProcessing timing data...\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "Processing 2021 Hungarian Grand Prix - Race\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "req INFO \tUsing cached data for car_data\n", "req INFO \tUsing cached data for position_data\n", "req INFO \tUsing cached data for weather_data\n", "req INFO \tUsing cached data for race_control_messages\n", "core INFO \tFinished loading data for 20 drivers: ['31', '44', '55', '14', '10', '22', '6', '63', '33', '7', '3', '47', '99', '9', '4', '77', '11', '16', '18', '5']\n", "core INFO \tLoading data for British Grand Prix - Race [v3.4.4]\n", "req INFO \tUsing cached data for session_info\n", "req INFO \tUsing cached data for driver_info\n", "req INFO \tUsing cached data for session_status_data\n", "req INFO \tUsing cached data for lap_count\n", "req INFO \tUsing cached data for track_status_data\n", "req INFO \tUsing cached data for _extended_timing_data\n", "req INFO \tUsing cached data for timing_app_data\n", "core INFO \tProcessing timing data...\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "Processing 2021 British Grand Prix - Race\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "req INFO \tUsing cached data for car_data\n", "req INFO \tUsing cached data for position_data\n", "req INFO \tUsing cached data for weather_data\n", "req INFO \tUsing cached data for race_control_messages\n", "core INFO \tFinished loading data for 20 drivers: ['44', '16', '77', '4', '3', '55', '14', '18', '31', '22', '10', '63', '99', '6', '7', '11', '9', '47', '5', '33']\n", "core INFO \tLoading data for Belgian Grand Prix - Race [v3.4.4]\n", "req INFO \tUsing cached data for session_info\n", "req INFO \tUsing cached data for driver_info\n", "req INFO \tUsing cached data for session_status_data\n", "req INFO \tUsing cached data for lap_count\n", "req INFO \tUsing cached data for track_status_data\n", "req INFO \tUsing cached data for _extended_timing_data\n", "req INFO \tUsing cached data for timing_app_data\n", "core INFO \tProcessing timing data...\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "Processing 2021 Belgian Grand Prix - Race\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "req INFO \tUsing cached data for car_data\n", "req INFO \tUsing cached data for position_data\n", "req INFO \tUsing cached data for weather_data\n", "req INFO \tUsing cached data for race_control_messages\n", "core INFO \tFinished loading data for 20 drivers: ['33', '63', '44', '3', '5', '10', '31', '16', '6', '55', '14', '77', '99', '4', '22', '47', '9', '7', '11', '18']\n", "core INFO \tLoading data for United States Grand Prix - Race [v3.4.4]\n", "req INFO \tUsing cached data for session_info\n", "req INFO \tUsing cached data for driver_info\n", "req INFO \tUsing cached data for session_status_data\n", "req INFO \tUsing cached data for lap_count\n", "req INFO \tUsing cached data for track_status_data\n", "req INFO \tUsing cached data for _extended_timing_data\n", "req INFO \tUsing cached data for timing_app_data\n", "core INFO \tProcessing timing data...\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "Processing 2021 United States Grand Prix - Race\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "core WARNING \tDriver 7: Lap timing integrity check failed for 1 lap(s)\n", "req INFO \tUsing cached data for car_data\n", "req INFO \tUsing cached data for position_data\n", "req INFO \tUsing cached data for weather_data\n", "req INFO \tUsing cached data for race_control_messages\n", "core INFO \tFinished loading data for 20 drivers: ['33', '44', '11', '16', '3', '77', '55', '4', '22', '5', '99', '18', '7', '63', '6', '47', '9', '14', '31', '10']\n", "core INFO \tLoading data for Mexico City Grand Prix - Race [v3.4.4]\n", "req INFO \tUsing cached data for session_info\n", "req INFO \tUsing cached data for driver_info\n", "req INFO \tUsing cached data for session_status_data\n", "req INFO \tUsing cached data for lap_count\n", "req INFO \tUsing cached data for track_status_data\n", "req INFO \tUsing cached data for _extended_timing_data\n", "req INFO \tUsing cached data for timing_app_data\n", "core INFO \tProcessing timing data...\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "Processing 2021 Mexico City Grand Prix - Race\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "req INFO \tUsing cached data for car_data\n", "req INFO \tUsing cached data for position_data\n", "req INFO \tUsing cached data for weather_data\n", "req INFO \tUsing cached data for race_control_messages\n", "core INFO \tFinished loading data for 20 drivers: ['33', '44', '11', '10', '16', '55', '5', '7', '14', '4', '99', '3', '31', '18', '77', '63', '6', '9', '47', '22']\n", "events WARNING \tCorrecting user input 'Sao Paulo Grand Prix' to 'São Paulo Grand Prix'\n", "core INFO \tLoading data for São Paulo Grand Prix - Race [v3.4.4]\n", "req INFO \tUsing cached data for session_info\n", "req INFO \tUsing cached data for driver_info\n", "req INFO \tUsing cached data for session_status_data\n", "req INFO \tUsing cached data for lap_count\n", "req INFO \tUsing cached data for track_status_data\n", "req INFO \tUsing cached data for _extended_timing_data\n", "req INFO \tUsing cached data for timing_app_data\n", "core INFO \tProcessing timing data...\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "Processing 2021 Sao Paulo Grand Prix - Race\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "req INFO \tUsing cached data for car_data\n", "req INFO \tUsing cached data for position_data\n", "req INFO \tUsing cached data for weather_data\n", "req INFO \tUsing cached data for race_control_messages\n", "core INFO \tFinished loading data for 20 drivers: ['44', '33', '77', '11', '16', '55', '10', '31', '14', '4', '5', '7', '63', '99', '22', '6', '9', '47', '3', '18']\n", "core INFO \tLoading data for Bahrain Grand Prix - Race [v3.4.4]\n", "req INFO \tUsing cached data for session_info\n", "req INFO \tUsing cached data for driver_info\n", "req INFO \tUsing cached data for session_status_data\n", "req INFO \tUsing cached data for lap_count\n", "req INFO \tUsing cached data for track_status_data\n", "req INFO \tUsing cached data for _extended_timing_data\n", "req INFO \tUsing cached data for timing_app_data\n", "core INFO \tProcessing timing data...\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "Processing 2022 Bahrain Grand Prix - Race\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "req INFO \tUsing cached data for car_data\n", "req INFO \tUsing cached data for position_data\n", "req INFO \tUsing cached data for weather_data\n", "req INFO \tUsing cached data for race_control_messages\n", "core INFO \tFinished loading data for 20 drivers: ['16', '55', '44', '63', '20', '77', '31', '22', '14', '24', '47', '18', '23', '3', '4', '6', '27', '11', '1', '10']\n", "core INFO \tLoading data for Saudi Arabian Grand Prix - Race [v3.4.4]\n", "req INFO \tUsing cached data for session_info\n", "req INFO \tUsing cached data for driver_info\n", "req INFO \tUsing cached data for session_status_data\n", "req INFO \tUsing cached data for lap_count\n", "req INFO \tUsing cached data for track_status_data\n", "req INFO \tUsing cached data for _extended_timing_data\n", "req INFO \tUsing cached data for timing_app_data\n", "core INFO \tProcessing timing data...\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "Processing 2022 Saudi Arabian Grand Prix - Race\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "core WARNING \tNo lap data for driver 22\n", "core WARNING \tNo lap data for driver 47\n", "core WARNING \tFailed to perform lap accuracy check - all laps marked as inaccurate (driver 22)\n", "core WARNING \tFailed to perform lap accuracy check - all laps marked as inaccurate (driver 47)\n", "req INFO \tUsing cached data for car_data\n", "req INFO \tUsing cached data for position_data\n", "req INFO \tUsing cached data for weather_data\n", "req INFO \tUsing cached data for race_control_messages\n", "core INFO \tFinished loading data for 20 drivers: ['1', '16', '55', '11', '63', '31', '4', '10', '20', '44', '24', '27', '18', '23', '77', '14', '3', '6', '22', '47']\n", "core INFO \tLoading data for Dutch Grand Prix - Race [v3.4.4]\n", "req INFO \tUsing cached data for session_info\n", "req INFO \tUsing cached data for driver_info\n", "req INFO \tUsing cached data for session_status_data\n", "req INFO \tUsing cached data for lap_count\n", "req INFO \tUsing cached data for track_status_data\n", "req INFO \tUsing cached data for _extended_timing_data\n", "req INFO \tUsing cached data for timing_app_data\n", "core INFO \tProcessing timing data...\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "Processing 2022 Dutch Grand Prix - Race\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "req INFO \tUsing cached data for car_data\n", "req INFO \tUsing cached data for position_data\n", "req INFO \tUsing cached data for weather_data\n", "req INFO \tUsing cached data for race_control_messages\n", "core INFO \tFinished loading data for 20 drivers: ['1', '63', '16', '44', '11', '14', '4', '55', '31', '18', '10', '23', '47', '5', '20', '24', '3', '6', '77', '22']\n", "core INFO \tLoading data for Italian Grand Prix - Race [v3.4.4]\n", "req INFO \tUsing cached data for session_info\n", "req INFO \tUsing cached data for driver_info\n", "req INFO \tUsing cached data for session_status_data\n", "req INFO \tUsing cached data for lap_count\n", "req INFO \tUsing cached data for track_status_data\n", "req INFO \tUsing cached data for _extended_timing_data\n", "req INFO \tUsing cached data for timing_app_data\n", "core INFO \tProcessing timing data...\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "Processing 2022 Italian Grand Prix - Race\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "req INFO \tUsing cached data for car_data\n", "req INFO \tUsing cached data for position_data\n", "req INFO \tUsing cached data for weather_data\n", "req INFO \tUsing cached data for race_control_messages\n", "core INFO \tFinished loading data for 20 drivers: ['1', '16', '63', '55', '44', '11', '4', '10', '45', '24', '31', '47', '77', '22', '6', '20', '3', '18', '14', '5']\n", "core INFO \tLoading data for Austrian Grand Prix - Race [v3.4.4]\n", "req INFO \tUsing cached data for session_info\n", "req INFO \tUsing cached data for driver_info\n", "req INFO \tUsing cached data for session_status_data\n", "req INFO \tUsing cached data for lap_count\n", "req INFO \tUsing cached data for track_status_data\n", "req INFO \tUsing cached data for _extended_timing_data\n", "req INFO \tUsing cached data for timing_app_data\n", "core INFO \tProcessing timing data...\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "Processing 2022 Austrian Grand Prix - Race\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "req INFO \tUsing cached data for car_data\n", "req INFO \tUsing cached data for position_data\n", "req INFO \tUsing cached data for weather_data\n", "req INFO \tUsing cached data for race_control_messages\n", "core INFO \tFinished loading data for 20 drivers: ['16', '1', '44', '63', '31', '47', '4', '20', '3', '14', '77', '23', '18', '24', '10', '22', '5', '55', '6', '11']\n", "core INFO \tLoading data for Hungarian Grand Prix - Race [v3.4.4]\n", "req INFO \tUsing cached data for session_info\n", "req INFO \tUsing cached data for driver_info\n", "req INFO \tUsing cached data for session_status_data\n", "req INFO \tUsing cached data for lap_count\n", "req INFO \tUsing cached data for track_status_data\n", "req INFO \tUsing cached data for _extended_timing_data\n", "req INFO \tUsing cached data for timing_app_data\n", "core INFO \tProcessing timing data...\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "Processing 2022 Hungarian Grand Prix - Race\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "req INFO \tUsing cached data for car_data\n", "req INFO \tUsing cached data for position_data\n", "req INFO \tUsing cached data for weather_data\n", "req INFO \tUsing cached data for race_control_messages\n", "core INFO \tFinished loading data for 20 drivers: ['1', '44', '63', '55', '11', '16', '4', '14', '31', '5', '18', '10', '24', '47', '3', '20', '23', '6', '22', '77']\n", "core INFO \tLoading data for British Grand Prix - Race [v3.4.4]\n", "req INFO \tUsing cached data for session_info\n", "req INFO \tUsing cached data for driver_info\n", "req INFO \tUsing cached data for session_status_data\n", "req INFO \tUsing cached data for lap_count\n", "req INFO \tUsing cached data for track_status_data\n", "req INFO \tUsing cached data for _extended_timing_data\n", "req INFO \tUsing cached data for timing_app_data\n", "core INFO \tProcessing timing data...\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "Processing 2022 British Grand Prix - Race\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "req INFO \tUsing cached data for car_data\n", "req INFO \tUsing cached data for position_data\n", "req INFO \tUsing cached data for weather_data\n", "req INFO \tUsing cached data for race_control_messages\n", "core INFO \tFinished loading data for 20 drivers: ['55', '11', '44', '16', '14', '4', '1', '47', '5', '20', '18', '6', '3', '22', '31', '10', '77', '63', '24', '23']\n", "core INFO \tLoading data for Belgian Grand Prix - Race [v3.4.4]\n", "req INFO \tUsing cached data for session_info\n", "req INFO \tUsing cached data for driver_info\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "Processing 2022 Belgian Grand Prix - Race\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "req INFO \tUsing cached data for session_status_data\n", "req INFO \tUsing cached data for lap_count\n", "req INFO \tUsing cached data for track_status_data\n", "req INFO \tUsing cached data for _extended_timing_data\n", "req INFO \tUsing cached data for timing_app_data\n", "core INFO \tProcessing timing data...\n", "req INFO \tUsing cached data for car_data\n", "req INFO \tUsing cached data for position_data\n", "req INFO \tUsing cached data for weather_data\n", "req INFO \tUsing cached data for race_control_messages\n", "core INFO \tFinished loading data for 20 drivers: ['1', '11', '55', '63', '14', '16', '31', '5', '10', '23', '18', '4', '22', '24', '3', '20', '47', '6', '77', '44']\n", "events WARNING \tCorrecting user input 'United States Grand Prix' to 'United States Grand Prix'\n", "core INFO \tLoading data for United States Grand Prix - Race [v3.4.4]\n", "req INFO \tUsing cached data for session_info\n", "req INFO \tUsing cached data for driver_info\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "Processing 2022 United States Grand Prix - Race\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "req INFO \tUsing cached data for session_status_data\n", "req INFO \tUsing cached data for lap_count\n", "req INFO \tUsing cached data for track_status_data\n", "req INFO \tUsing cached data for _extended_timing_data\n", "req INFO \tUsing cached data for timing_app_data\n", "core INFO \tProcessing timing data...\n", "req INFO \tUsing cached data for car_data\n", "req INFO \tUsing cached data for position_data\n", "req INFO \tUsing cached data for weather_data\n", "req INFO \tUsing cached data for race_control_messages\n", "core INFO \tFinished loading data for 20 drivers: ['1', '44', '16', '11', '63', '4', '14', '5', '20', '22', '31', '24', '23', '10', '47', '3', '6', '18', '77', '55']\n", "core INFO \tLoading data for Mexico City Grand Prix - Race [v3.4.4]\n", "req INFO \tUsing cached data for session_info\n", "req INFO \tUsing cached data for driver_info\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "Processing 2022 Mexico City Grand Prix - Race\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "req INFO \tUsing cached data for session_status_data\n", "req INFO \tUsing cached data for lap_count\n", "req INFO \tUsing cached data for track_status_data\n", "req INFO \tUsing cached data for _extended_timing_data\n", "req INFO \tUsing cached data for timing_app_data\n", "core INFO \tProcessing timing data...\n", "req INFO \tUsing cached data for car_data\n", "req INFO \tUsing cached data for position_data\n", "req INFO \tUsing cached data for weather_data\n", "req INFO \tUsing cached data for race_control_messages\n", "core INFO \tFinished loading data for 20 drivers: ['1', '44', '11', '63', '55', '16', '3', '31', '4', '77', '10', '23', '24', '5', '18', '47', '20', '6', '14', '22']\n", "events WARNING \tCorrecting user input 'Sao Paulo Grand Prix' to 'São Paulo Grand Prix'\n", "core INFO \tLoading data for São Paulo Grand Prix - Race [v3.4.4]\n", "req INFO \tUsing cached data for session_info\n", "req INFO \tUsing cached data for driver_info\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "Processing 2022 Sao Paulo Grand Prix - Race\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "req INFO \tUsing cached data for session_status_data\n", "req INFO \tUsing cached data for lap_count\n", "req INFO \tUsing cached data for track_status_data\n", "req INFO \tUsing cached data for _extended_timing_data\n", "req INFO \tUsing cached data for timing_app_data\n", "core INFO \tProcessing timing data...\n", "req INFO \tUsing cached data for car_data\n", "req INFO \tUsing cached data for position_data\n", "req INFO \tUsing cached data for weather_data\n", "req INFO \tUsing cached data for race_control_messages\n", "core INFO \tFinished loading data for 20 drivers: ['63', '44', '55', '16', '14', '1', '11', '31', '77', '18', '5', '24', '47', '10', '23', '6', '22', '4', '20', '3']\n", "core INFO \tLoading data for Bahrain Grand Prix - Race [v3.4.4]\n", "req INFO \tUsing cached data for session_info\n", "req INFO \tUsing cached data for driver_info\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "Processing 2023 Bahrain Grand Prix - Race\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "req INFO \tUsing cached data for session_status_data\n", "req INFO \tUsing cached data for lap_count\n", "req INFO \tUsing cached data for track_status_data\n", "req INFO \tUsing cached data for _extended_timing_data\n", "req INFO \tUsing cached data for timing_app_data\n", "core INFO \tProcessing timing data...\n", "req INFO \tUsing cached data for car_data\n", "req INFO \tUsing cached data for position_data\n", "req INFO \tUsing cached data for weather_data\n", "req INFO \tUsing cached data for race_control_messages\n", "core INFO \tFinished loading data for 20 drivers: ['1', '11', '14', '55', '44', '18', '63', '77', '10', '23', '22', '2', '20', '21', '27', '24', '4', '31', '16', '81']\n", "core INFO \tLoading data for Saudi Arabian Grand Prix - Race [v3.4.4]\n", "req INFO \tUsing cached data for session_info\n", "req INFO \tUsing cached data for driver_info\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "Processing 2023 Saudi Arabian Grand Prix - Race\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "req INFO \tUsing cached data for session_status_data\n", "req INFO \tUsing cached data for lap_count\n", "req INFO \tUsing cached data for track_status_data\n", "req INFO \tUsing cached data for _extended_timing_data\n", "req INFO \tUsing cached data for timing_app_data\n", "core INFO \tProcessing timing data...\n", "req INFO \tUsing cached data for car_data\n", "req INFO \tUsing cached data for position_data\n", "req INFO \tUsing cached data for weather_data\n", "req INFO \tUsing cached data for race_control_messages\n", "core INFO \tFinished loading data for 20 drivers: ['11', '1', '14', '63', '44', '55', '16', '31', '10', '20', '22', '27', '24', '21', '81', '2', '4', '77', '23', '18']\n", "core INFO \tLoading data for Dutch Grand Prix - Race [v3.4.4]\n", "req INFO \tUsing cached data for session_info\n", "req INFO \tUsing cached data for driver_info\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "Processing 2023 Dutch Grand Prix - Race\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "req INFO \tUsing cached data for session_status_data\n", "req INFO \tUsing cached data for lap_count\n", "req INFO \tUsing cached data for track_status_data\n", "req INFO \tUsing cached data for _extended_timing_data\n", "req INFO \tUsing cached data for timing_app_data\n", "core INFO \tProcessing timing data...\n", "req INFO \tUsing cached data for car_data\n", "req INFO \tUsing cached data for position_data\n", "req INFO \tUsing cached data for weather_data\n", "req INFO \tUsing cached data for race_control_messages\n", "core INFO \tFinished loading data for 20 drivers: ['1', '14', '10', '11', '55', '44', '4', '23', '81', '31', '18', '27', '40', '77', '22', '20', '63', '24', '16', '2']\n", "core INFO \tLoading data for Italian Grand Prix - Race [v3.4.4]\n", "req INFO \tUsing cached data for session_info\n", "req INFO \tUsing cached data for driver_info\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "Processing 2023 Italian Grand Prix - Race\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "req INFO \tUsing cached data for session_status_data\n", "req INFO \tUsing cached data for lap_count\n", "req INFO \tUsing cached data for track_status_data\n", "req INFO \tUsing cached data for _extended_timing_data\n", "req INFO \tUsing cached data for timing_app_data\n", "core INFO \tProcessing timing data...\n", "req INFO \tUsing cached data for car_data\n", "req INFO \tUsing cached data for position_data\n", "req INFO \tUsing cached data for weather_data\n", "req INFO \tUsing cached data for race_control_messages\n", "core INFO \tFinished loading data for 20 drivers: ['1', '11', '55', '16', '63', '44', '23', '4', '14', '77', '40', '81', '2', '24', '10', '18', '27', '20', '31', '22']\n", "core INFO \tLoading data for Austrian Grand Prix - Race [v3.4.4]\n", "req INFO \tUsing cached data for session_info\n", "req INFO \tUsing cached data for driver_info\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "Processing 2023 Austrian Grand Prix - Race\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "req INFO \tUsing cached data for session_status_data\n", "req INFO \tUsing cached data for lap_count\n", "req INFO \tUsing cached data for track_status_data\n", "req INFO \tUsing cached data for _extended_timing_data\n", "req INFO \tUsing cached data for timing_app_data\n", "core INFO \tProcessing timing data...\n", "req INFO \tUsing cached data for car_data\n", "req INFO \tUsing cached data for position_data\n", "req INFO \tUsing cached data for weather_data\n", "req INFO \tUsing cached data for race_control_messages\n", "core INFO \tFinished loading data for 20 drivers: ['1', '16', '11', '4', '14', '55', '63', '44', '18', '10', '23', '24', '2', '31', '77', '81', '21', '20', '22', '27']\n", "core INFO \tLoading data for Hungarian Grand Prix - Race [v3.4.4]\n", "req INFO \tUsing cached data for session_info\n", "req INFO \tUsing cached data for driver_info\n", "req INFO \tUsing cached data for session_status_data\n", "req INFO \tUsing cached data for lap_count\n", "req INFO \tUsing cached data for track_status_data\n", "req INFO \tUsing cached data for _extended_timing_data\n", "req INFO \tUsing cached data for timing_app_data\n", "core INFO \tProcessing timing data...\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "Processing 2023 Hungarian Grand Prix - Race\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "req INFO \tUsing cached data for car_data\n", "req INFO \tUsing cached data for position_data\n", "req INFO \tUsing cached data for weather_data\n", "req INFO \tUsing cached data for race_control_messages\n", "core INFO \tFinished loading data for 20 drivers: ['1', '4', '11', '44', '81', '63', '16', '55', '14', '18', '23', '77', '3', '27', '22', '24', '20', '2', '31', '10']\n", "core INFO \tLoading data for British Grand Prix - Race [v3.4.4]\n", "req INFO \tUsing cached data for session_info\n", "req INFO \tUsing cached data for driver_info\n", "req INFO \tUsing cached data for session_status_data\n", "req INFO \tUsing cached data for lap_count\n", "req INFO \tUsing cached data for track_status_data\n", "req INFO \tUsing cached data for _extended_timing_data\n", "req INFO \tUsing cached data for timing_app_data\n", "core INFO \tProcessing timing data...\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "Processing 2023 British Grand Prix - Race\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "req INFO \tUsing cached data for car_data\n", "req INFO \tUsing cached data for position_data\n", "req INFO \tUsing cached data for weather_data\n", "req INFO \tUsing cached data for race_control_messages\n", "core INFO \tFinished loading data for 20 drivers: ['1', '4', '44', '81', '63', '11', '14', '23', '16', '55', '2', '77', '27', '18', '24', '22', '21', '10', '20', '31']\n", "core INFO \tLoading data for Belgian Grand Prix - Race [v3.4.4]\n", "req INFO \tUsing cached data for session_info\n", "req INFO \tUsing cached data for driver_info\n", "req INFO \tUsing cached data for session_status_data\n", "req INFO \tUsing cached data for lap_count\n", "req INFO \tUsing cached data for track_status_data\n", "req INFO \tUsing cached data for _extended_timing_data\n", "req INFO \tUsing cached data for timing_app_data\n", "core INFO \tProcessing timing data...\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "Processing 2023 Belgian Grand Prix - Race\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "req INFO \tUsing cached data for car_data\n", "req INFO \tUsing cached data for position_data\n", "req INFO \tUsing cached data for weather_data\n", "req INFO \tUsing cached data for race_control_messages\n", "core INFO \tFinished loading data for 20 drivers: ['1', '11', '16', '44', '14', '63', '4', '31', '18', '22', '10', '77', '24', '23', '20', '3', '2', '27', '55', '81']\n", "events WARNING \tCorrecting user input 'United States Grand Prix' to 'United States Grand Prix'\n", "core INFO \tLoading data for United States Grand Prix - Race [v3.4.4]\n", "req INFO \tUsing cached data for session_info\n", "req INFO \tUsing cached data for driver_info\n", "req INFO \tUsing cached data for session_status_data\n", "req INFO \tUsing cached data for lap_count\n", "req INFO \tUsing cached data for track_status_data\n", "req INFO \tUsing cached data for _extended_timing_data\n", "req INFO \tUsing cached data for timing_app_data\n", "core INFO \tProcessing timing data...\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "Processing 2023 United States Grand Prix - Race\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "req INFO \tUsing cached data for car_data\n", "req INFO \tUsing cached data for position_data\n", "req INFO \tUsing cached data for weather_data\n", "req INFO \tUsing cached data for race_control_messages\n", "core INFO \tFinished loading data for 20 drivers: ['1', '4', '55', '11', '63', '10', '18', '22', '23', '2', '27', '77', '24', '20', '3', '14', '81', '31', '44', '16']\n", "core INFO \tLoading data for Mexico City Grand Prix - Race [v3.4.4]\n", "req INFO \tUsing cached data for session_info\n", "req INFO \tUsing cached data for driver_info\n", "req INFO \tUsing cached data for session_status_data\n", "req INFO \tUsing cached data for lap_count\n", "req INFO \tUsing cached data for track_status_data\n", "req INFO \tUsing cached data for _extended_timing_data\n", "req INFO \tUsing cached data for timing_app_data\n", "core INFO \tProcessing timing data...\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "Processing 2023 Mexico City Grand Prix - Race\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "req INFO \tUsing cached data for car_data\n", "req INFO \tUsing cached data for position_data\n", "req INFO \tUsing cached data for weather_data\n", "req INFO \tUsing cached data for race_control_messages\n", "core INFO \tFinished loading data for 20 drivers: ['1', '44', '16', '55', '4', '63', '3', '81', '23', '31', '10', '22', '27', '24', '77', '2', '18', '14', '20', '11']\n", "events WARNING \tCorrecting user input 'Sao Paulo Grand Prix' to 'São Paulo Grand Prix'\n", "core INFO \tLoading data for São Paulo Grand Prix - Race [v3.4.4]\n", "req INFO \tUsing cached data for session_info\n", "req INFO \tUsing cached data for driver_info\n", "req INFO \tUsing cached data for session_status_data\n", "req INFO \tUsing cached data for lap_count\n", "req INFO \tUsing cached data for track_status_data\n", "req INFO \tUsing cached data for _extended_timing_data\n", "req INFO \tUsing cached data for timing_app_data\n", "core INFO \tProcessing timing data...\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "Processing 2023 Sao Paulo Grand Prix - Race\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "req INFO \tUsing cached data for car_data\n", "req INFO \tUsing cached data for position_data\n", "req INFO \tUsing cached data for weather_data\n", "req INFO \tUsing cached data for race_control_messages\n", "core INFO \tFinished loading data for 20 drivers: ['1', '4', '14', '11', '18', '55', '10', '44', '22', '31', '2', '27', '3', '81', '63', '77', '24', '20', '23', '16']\n", "core INFO \tLoading data for Bahrain Grand Prix - Race [v3.4.4]\n", "req INFO \tUsing cached data for session_info\n", "req INFO \tUsing cached data for driver_info\n", "req INFO \tUsing cached data for session_status_data\n", "req INFO \tUsing cached data for lap_count\n", "req INFO \tUsing cached data for track_status_data\n", "req INFO \tUsing cached data for _extended_timing_data\n", "req INFO \tUsing cached data for timing_app_data\n", "core INFO \tProcessing timing data...\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "Processing 2024 Bahrain Grand Prix - Race\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "req INFO \tUsing cached data for car_data\n", "req INFO \tUsing cached data for position_data\n", "req INFO \tUsing cached data for weather_data\n", "req INFO \tUsing cached data for race_control_messages\n", "core INFO \tFinished loading data for 20 drivers: ['1', '11', '55', '16', '63', '4', '44', '81', '14', '18', '24', '20', '3', '22', '23', '27', '31', '10', '77', '2']\n", "core INFO \tLoading data for Saudi Arabian Grand Prix - Race [v3.4.4]\n", "req INFO \tUsing cached data for session_info\n", "req INFO \tUsing cached data for driver_info\n", "req INFO \tUsing cached data for session_status_data\n", "req INFO \tUsing cached data for lap_count\n", "req INFO \tUsing cached data for track_status_data\n", "req INFO \tUsing cached data for _extended_timing_data\n", "req INFO \tUsing cached data for timing_app_data\n", "core INFO \tProcessing timing data...\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "Processing 2024 Saudi Arabian Grand Prix - Race\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "req INFO \tUsing cached data for car_data\n", "req INFO \tUsing cached data for position_data\n", "req INFO \tUsing cached data for weather_data\n", "req INFO \tUsing cached data for race_control_messages\n", "core INFO \tFinished loading data for 20 drivers: ['1', '11', '16', '81', '14', '63', '38', '4', '44', '27', '23', '20', '31', '2', '22', '3', '77', '24', '18', '10']\n", "core INFO \tLoading data for Dutch Grand Prix - Race [v3.4.4]\n", "req INFO \tNo cached data found for session_info. Loading data...\n", "_api INFO \tFetching session info data...\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "Processing 2024 Dutch Grand Prix - Race\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "req INFO \tData has been written to cache!\n", "req INFO \tNo cached data found for driver_info. Loading data...\n", "_api INFO \tFetching driver list...\n", "req INFO \tData has been written to cache!\n", "req INFO \tNo cached data found for session_status_data. Loading data...\n", "_api INFO \tFetching session status data...\n", "req INFO \tData has been written to cache!\n", "req INFO \tNo cached data found for lap_count. Loading data...\n", "_api INFO \tFetching lap count data...\n", "req INFO \tData has been written to cache!\n", "req INFO \tNo cached data found for track_status_data. Loading data...\n", "_api INFO \tFetching track status data...\n", "req INFO \tData has been written to cache!\n", "req INFO \tNo cached data found for _extended_timing_data. Loading data...\n", "_api INFO \tFetching timing data...\n", "_api INFO \tParsing timing data...\n", "req INFO \tData has been written to cache!\n", "req INFO \tNo cached data found for timing_app_data. Loading data...\n", "_api INFO \tFetching timing app data...\n", "req INFO \tData has been written to cache!\n", "core INFO \tProcessing timing data...\n", "req INFO \tNo cached data found for car_data. Loading data...\n", "_api INFO \tFetching car data...\n", "_api INFO \tParsing car data...\n", "req INFO \tData has been written to cache!\n", "req INFO \tNo cached data found for position_data. Loading data...\n", "_api INFO \tFetching position data...\n", "_api INFO \tParsing position data...\n", "req INFO \tData has been written to cache!\n", "req INFO \tNo cached data found for weather_data. Loading data...\n", "_api INFO \tFetching weather data...\n", "req INFO \tData has been written to cache!\n", "req INFO \tNo cached data found for race_control_messages. Loading data...\n", "_api INFO \tFetching race control messages...\n", "req INFO \tData has been written to cache!\n", "core INFO \tFinished loading data for 20 drivers: ['4', '1', '16', '81', '55', '11', '63', '44', '10', '14', '27', '3', '18', '23', '31', '2', '22', '20', '77', '24']\n", "core INFO \tLoading data for Italian Grand Prix - Race [v3.4.4]\n", "req INFO \tNo cached data found for session_info. Loading data...\n", "_api INFO \tFetching session info data...\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "Processing 2024 Italian Grand Prix - Race\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "req INFO \tData has been written to cache!\n", "req INFO \tNo cached data found for driver_info. Loading data...\n", "_api INFO \tFetching driver list...\n", "req INFO \tData has been written to cache!\n", "req INFO \tNo cached data found for session_status_data. Loading data...\n", "_api INFO \tFetching session status data...\n", "req INFO \tData has been written to cache!\n", "req INFO \tNo cached data found for lap_count. Loading data...\n", "_api INFO \tFetching lap count data...\n", "req INFO \tData has been written to cache!\n", "req INFO \tNo cached data found for track_status_data. Loading data...\n", "_api INFO \tFetching track status data...\n", "req INFO \tData has been written to cache!\n", "req INFO \tNo cached data found for _extended_timing_data. Loading data...\n", "_api INFO \tFetching timing data...\n", "_api INFO \tParsing timing data...\n", "req INFO \tData has been written to cache!\n", "req INFO \tNo cached data found for timing_app_data. Loading data...\n", "_api INFO \tFetching timing app data...\n", "req INFO \tData has been written to cache!\n", "core INFO \tProcessing timing data...\n", "req INFO \tNo cached data found for car_data. Loading data...\n", "_api INFO \tFetching car data...\n", "_api INFO \tParsing car data...\n", "req INFO \tData has been written to cache!\n", "req INFO \tNo cached data found for position_data. Loading data...\n", "_api INFO \tFetching position data...\n", "_api INFO \tParsing position data...\n", "req INFO \tData has been written to cache!\n", "req INFO \tNo cached data found for weather_data. Loading data...\n", "_api INFO \tFetching weather data...\n", "req INFO \tData has been written to cache!\n", "req INFO \tNo cached data found for race_control_messages. Loading data...\n", "_api INFO \tFetching race control messages...\n", "req INFO \tData has been written to cache!\n", "core INFO \tFinished loading data for 20 drivers: ['16', '81', '4', '55', '44', '1', '63', '11', '23', '20', '14', '43', '3', '31', '10', '77', '27', '24', '18', '22']\n", "core INFO \tLoading data for Austrian Grand Prix - Race [v3.4.4]\n", "req INFO \tUsing cached data for session_info\n", "req INFO \tUsing cached data for driver_info\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "Processing 2024 Austrian Grand Prix - Race\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "req INFO \tUsing cached data for session_status_data\n", "req INFO \tUsing cached data for lap_count\n", "req INFO \tUsing cached data for track_status_data\n", "req INFO \tUsing cached data for _extended_timing_data\n", "req INFO \tUsing cached data for timing_app_data\n", "core INFO \tProcessing timing data...\n", "req INFO \tUsing cached data for car_data\n", "req INFO \tUsing cached data for position_data\n", "req INFO \tUsing cached data for weather_data\n", "req INFO \tUsing cached data for race_control_messages\n", "core INFO \tFinished loading data for 20 drivers: ['63', '81', '55', '44', '1', '27', '11', '20', '3', '10', '16', '31', '18', '22', '23', '77', '24', '14', '2', '4']\n", "core INFO \tLoading data for Hungarian Grand Prix - Race [v3.4.4]\n", "req INFO \tNo cached data found for session_info. Loading data...\n", "_api INFO \tFetching session info data...\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "Processing 2024 Hungarian Grand Prix - Race\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "req INFO \tData has been written to cache!\n", "req INFO \tNo cached data found for driver_info. Loading data...\n", "_api INFO \tFetching driver list...\n", "req INFO \tData has been written to cache!\n", "req INFO \tNo cached data found for session_status_data. Loading data...\n", "_api INFO \tFetching session status data...\n", "req INFO \tData has been written to cache!\n", "req INFO \tNo cached data found for lap_count. Loading data...\n", "_api INFO \tFetching lap count data...\n", "req INFO \tData has been written to cache!\n", "req INFO \tNo cached data found for track_status_data. Loading data...\n", "_api INFO \tFetching track status data...\n", "req INFO \tData has been written to cache!\n", "req INFO \tNo cached data found for _extended_timing_data. Loading data...\n", "_api INFO \tFetching timing data...\n", "_api INFO \tParsing timing data...\n", "req INFO \tData has been written to cache!\n", "req INFO \tNo cached data found for timing_app_data. Loading data...\n", "_api INFO \tFetching timing app data...\n", "req INFO \tData has been written to cache!\n", "core INFO \tProcessing timing data...\n", "req INFO \tNo cached data found for car_data. Loading data...\n", "_api INFO \tFetching car data...\n", "_api INFO \tParsing car data...\n", "req INFO \tData has been written to cache!\n", "req INFO \tNo cached data found for position_data. Loading data...\n", "_api INFO \tFetching position data...\n", "_api INFO \tParsing position data...\n", "req INFO \tData has been written to cache!\n", "req INFO \tNo cached data found for weather_data. Loading data...\n", "_api INFO \tFetching weather data...\n", "req INFO \tData has been written to cache!\n", "req INFO \tNo cached data found for race_control_messages. Loading data...\n", "_api INFO \tFetching race control messages...\n", "req INFO \tData has been written to cache!\n", "core INFO \tFinished loading data for 20 drivers: ['81', '4', '44', '16', '1', '55', '11', '63', '22', '18', '14', '3', '27', '23', '20', '77', '2', '31', '24', '10']\n", "core INFO \tLoading data for British Grand Prix - Race [v3.4.4]\n", "req INFO \tUsing cached data for session_info\n", "req INFO \tUsing cached data for driver_info\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "Processing 2024 British Grand Prix - Race\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "req INFO \tUsing cached data for session_status_data\n", "req INFO \tUsing cached data for lap_count\n", "req INFO \tUsing cached data for track_status_data\n", "req INFO \tUsing cached data for _extended_timing_data\n", "req INFO \tUsing cached data for timing_app_data\n", "core INFO \tProcessing timing data...\n", "req INFO \tUsing cached data for car_data\n", "req INFO \tUsing cached data for position_data\n", "req INFO \tUsing cached data for weather_data\n", "req INFO \tUsing cached data for race_control_messages\n", "core INFO \tFinished loading data for 20 drivers: ['44', '1', '4', '81', '55', '27', '18', '14', '23', '22', '2', '20', '3', '16', '77', '31', '11', '24', '63', '10']\n", "core INFO \tLoading data for Belgian Grand Prix - Race [v3.4.4]\n", "req INFO \tNo cached data found for session_info. Loading data...\n", "_api INFO \tFetching session info data...\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "Processing 2024 Belgian Grand Prix - Race\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "req INFO \tData has been written to cache!\n", "req INFO \tNo cached data found for driver_info. Loading data...\n", "_api INFO \tFetching driver list...\n", "req INFO \tData has been written to cache!\n", "req INFO \tNo cached data found for session_status_data. Loading data...\n", "_api INFO \tFetching session status data...\n", "req INFO \tData has been written to cache!\n", "req INFO \tNo cached data found for lap_count. Loading data...\n", "_api INFO \tFetching lap count data...\n", "req INFO \tData has been written to cache!\n", "req INFO \tNo cached data found for track_status_data. Loading data...\n", "_api INFO \tFetching track status data...\n", "req INFO \tData has been written to cache!\n", "req INFO \tNo cached data found for _extended_timing_data. Loading data...\n", "_api INFO \tFetching timing data...\n", "_api INFO \tParsing timing data...\n", "req INFO \tData has been written to cache!\n", "req INFO \tNo cached data found for timing_app_data. Loading data...\n", "_api INFO \tFetching timing app data...\n", "req INFO \tData has been written to cache!\n", "core INFO \tProcessing timing data...\n", "req INFO \tNo cached data found for car_data. Loading data...\n", "_api INFO \tFetching car data...\n", "_api INFO \tParsing car data...\n", "req INFO \tData has been written to cache!\n", "req INFO \tNo cached data found for position_data. Loading data...\n", "_api INFO \tFetching position data...\n", "_api INFO \tParsing position data...\n", "req INFO \tData has been written to cache!\n", "req INFO \tNo cached data found for weather_data. Loading data...\n", "_api INFO \tFetching weather data...\n", "req INFO \tData has been written to cache!\n", "req INFO \tNo cached data found for race_control_messages. Loading data...\n", "_api INFO \tFetching race control messages...\n", "req INFO \tData has been written to cache!\n", "core INFO \tFinished loading data for 20 drivers: ['44', '81', '16', '1', '4', '55', '11', '14', '31', '3', '18', '23', '10', '20', '77', '22', '2', '27', '24', '63']\n", "events WARNING \tCorrecting user input 'United States Grand Prix' to 'United States Grand Prix'\n", "core INFO \tLoading data for United States Grand Prix - Race [v3.4.4]\n", "req INFO \tUsing cached data for session_info\n", "req INFO \tUsing cached data for driver_info\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "Processing 2024 United States Grand Prix - Race\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "req INFO \tUsing cached data for session_status_data\n", "req INFO \tUsing cached data for lap_count\n", "req INFO \tUsing cached data for track_status_data\n", "req INFO \tUsing cached data for _extended_timing_data\n", "req INFO \tUsing cached data for timing_app_data\n", "core INFO \tProcessing timing data...\n", "req INFO \tUsing cached data for car_data\n", "req INFO \tUsing cached data for position_data\n", "req INFO \tUsing cached data for weather_data\n", "req INFO \tUsing cached data for race_control_messages\n", "core INFO \tFinished loading data for 20 drivers: ['16', '55', '1', '4', '81', '63', '11', '27', '30', '43', '20', '10', '14', '22', '18', '23', '77', '31', '24', '44']\n", "core INFO \tLoading data for Mexico City Grand Prix - Race [v3.4.4]\n", "req INFO \tUsing cached data for session_info\n", "req INFO \tUsing cached data for driver_info\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "Processing 2024 Mexico City Grand Prix - Race\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "req INFO \tUsing cached data for session_status_data\n", "req INFO \tUsing cached data for lap_count\n", "req INFO \tUsing cached data for track_status_data\n", "req INFO \tUsing cached data for _extended_timing_data\n", "req INFO \tUsing cached data for timing_app_data\n", "core INFO \tProcessing timing data...\n", "req INFO \tUsing cached data for car_data\n", "req INFO \tUsing cached data for position_data\n", "req INFO \tUsing cached data for weather_data\n", "req INFO \tUsing cached data for race_control_messages\n", "core INFO \tFinished loading data for 20 drivers: ['55', '4', '16', '44', '63', '1', '20', '81', '27', '10', '18', '43', '31', '77', '24', '30', '11', '14', '23', '22']\n", "events WARNING \tCorrecting user input 'Sao Paulo Grand Prix' to 'São Paulo Grand Prix'\n", "core INFO \tLoading data for São Paulo Grand Prix - Race [v3.4.4]\n", "req INFO \tUsing cached data for session_info\n", "req INFO \tUsing cached data for driver_info\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "Processing 2024 Sao Paulo Grand Prix - Race\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "req INFO \tUsing cached data for session_status_data\n", "req INFO \tUsing cached data for lap_count\n", "req INFO \tUsing cached data for track_status_data\n", "req INFO \tUsing cached data for _extended_timing_data\n", "req INFO \tUsing cached data for timing_app_data\n", "core INFO \tProcessing timing data...\n", "core WARNING \tNo lap data for driver 23\n", "core WARNING \tFailed to perform lap accuracy check - all laps marked as inaccurate (driver 23)\n", "req INFO \tUsing cached data for car_data\n", "req INFO \tUsing cached data for position_data\n", "req INFO \tUsing cached data for weather_data\n", "req INFO \tUsing cached data for race_control_messages\n", "core INFO \tFinished loading data for 20 drivers: ['1', '31', '10', '63', '16', '4', '22', '81', '30', '44', '11', '50', '77', '14', '24', '55', '43', '23', '18', '27']\n" ] } ], "source": [ "# Get data from FastF1 API\n", "\n", "# Data containers\n", "weather_data_list = []\n", "lap_data_list = []\n", "\n", "# Loop through years and sessions\n", "for year in years:\n", " for event_name in events: \n", " for session_name in sessions:\n", " try:\n", " print(f\"Processing {year} {event_name} - {session_name}\")\n", " \n", " # Load the session\n", " session = fastf1.get_session(year, event_name, session_name, backend='fastf1')\n", " session.load()\n", " \n", " # Process weather data\n", " weather_data = session.weather_data\n", " if weather_data is not None:\n", " weather_df = pd.DataFrame(weather_data)\n", " # Add context columns\n", " weather_df['Year'] = year\n", " weather_df['Event'] = event_name\n", " weather_df['Session'] = session_name\n", " weather_data_list.append(weather_df)\n", "\n", " # Process lap data\n", " lap_data = session.laps\n", " if lap_data is not None:\n", " lap_df = pd.DataFrame(lap_data)\n", " # Add context columns\n", " lap_df['Year'] = year\n", " lap_df['Event'] = event_name\n", " lap_df['Session'] = session_name\n", " # Ensure driver information is included\n", " if 'Driver' not in lap_df.columns:\n", " lap_df['Driver'] = lap_df['DriverNumber'].map(session.drivers)\n", " # Add team information if available\n", " if 'Team' not in lap_df.columns:\n", " lap_df['Team'] = lap_df['Driver'].map(session.drivers_info['TeamName'])\n", " lap_data_list.append(lap_df)\n", " \n", " except Exception as e:\n", " print(f\"Error with {event_name} {session_name} ({year}): {e}\")\n", "\n", "# Combine data into DataFrames\n", "if weather_data_list:\n", " weather_data_combined = pd.concat(weather_data_list, ignore_index=True)\n", " # Ensure consistent column ordering\n", " weather_cols = ['Time', 'Year', 'Event', 'Session', \n", " 'AirTemp', 'Humidity', 'Pressure', 'Rainfall', \n", " 'TrackTemp', 'WindDirection', 'WindSpeed']\n", " weather_data_combined = weather_data_combined[weather_cols]\n", " \n", "if lap_data_list:\n", " lap_data_combined = pd.concat(lap_data_list, ignore_index=True)\n", " # Ensure consistent column ordering\n", " lap_cols = ['Time', 'Year', 'Event', 'Session', \n", " 'Driver', 'Team', 'LapNumber', 'LapTime',\n", " 'Sector1Time', 'Sector2Time', 'Sector3Time',\n", " 'Compound', 'TyreLife', 'FreshTyre',\n", " 'SpeedI1', 'SpeedI2', 'SpeedFL', 'SpeedST']\n", " # Only include columns that exist\n", " existing_cols = [col for col in lap_cols if col in lap_data_combined.columns]\n", " lap_data_combined = lap_data_combined[existing_cols]\n", " \n", "# Time conversion\n", "# Function to convert timedelta to datetime\n", "def convert_timedelta_to_datetime(df, base_date='2021-01-01'):\n", " if 'Time' in df.columns:\n", " # Create a base datetime and add the timedelta\n", " base = pd.Timestamp(base_date)\n", " if df['Time'].dtype == 'timedelta64[ns]':\n", " df['Time'] = base + df['Time']\n", " return df\n", "\n", "# Apply conversion to both dataframes\n", "weather_data_combined = convert_timedelta_to_datetime(weather_data_combined)\n", "lap_data_combined = convert_timedelta_to_datetime(lap_data_combined)\n", "\n", "# Remove missing values\n", "weather_data_combined = weather_data_combined.dropna()\n", "lap_data_combined = lap_data_combined.dropna()\n", "\n", "# Create a new column for lap time in seconds\n", "lap_data_combined['LapTime_seconds'] = lap_data_combined['LapTime'].dt.total_seconds()\n", "\n", "# Merge the data\n", "merged_data = pd.merge_asof(\n", " lap_data_combined.sort_values('Time'),\n", " weather_data_combined.sort_values('Time'),\n", " on='Time',\n", " by=['Event', 'Year'], # Match within same event and year\n", " direction='nearest',\n", " tolerance=pd.Timedelta('1 min') # Allow matching within 1 minute\n", ")\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Data Description\n", "Our data comes from the FastF1 API, which provides detailed Formula One racing data. Each observation represents a single lap during a race or qualifying session, including:\n", "\n", "Key Variables:\n", "- **Time**: Timestamp of the lap\n", "- **Driver**: Driver identifier\n", "- **LapTime**: Time taken to complete the lap\n", "- **Weather Conditions**:\n", " - TrackTemp: Track temperature in Celsius\n", " - AirTemp: Air temperature in Celsius\n", " - Humidity: Percentage\n", " - Rainfall: Boolean indicating presence of rain\n", "- **Performance Metrics**:\n", " - Sector times (1,2,3)\n", " - Speed measurements at various points\n", " - Compound: Tire compound used\n", " - TyreLife: Age of tires in laps\n", "\n", "Each lap is represented as a fixed-length vector containing these attributes, making it suitable for machine learning algorithms." ] }, { "cell_type": "code", "execution_count": 21, "metadata": { "ExecuteTime": { "end_time": "2024-12-10T17:46:25.733104Z", "start_time": "2024-12-10T17:46:25.694313Z" } }, "outputs": [ { "data": { "text/html": [ "
| \n", " | Time | \n", "Year | \n", "Event | \n", "Session | \n", "Driver | \n", "Team | \n", "LapNumber | \n", "LapTime | \n", "Sector1Time | \n", "Sector2Time | \n", "Sector3Time | \n", "Compound | \n", "TyreLife | \n", "FreshTyre | \n", "SpeedI1 | \n", "SpeedI2 | \n", "SpeedFL | \n", "SpeedST | \n", "LapTime_seconds | \n", "
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | \n", "2021-01-01 00:41:37.134 | \n", "2021 | \n", "Bahrain Grand Prix | \n", "Race | \n", "GAS | \n", "AlphaTauri | \n", "2.0 | \n", "0 days 00:02:22.263000 | \n", "0 days 00:00:45.220000 | \n", "0 days 00:01:00.086000 | \n", "0 days 00:00:36.957000 | \n", "MEDIUM | \n", "5.0 | \n", "False | \n", "120.0 | \n", "134.0 | \n", "182.0 | \n", "236.0 | \n", "142.263 | \n", "
| 4 | \n", "2021-01-01 00:48:28.044 | \n", "2021 | \n", "Bahrain Grand Prix | \n", "Race | \n", "GAS | \n", "AlphaTauri | \n", "5.0 | \n", "0 days 00:02:11.534000 | \n", "0 days 00:01:05.748000 | \n", "0 days 00:00:41.956000 | \n", "0 days 00:00:23.830000 | \n", "HARD | \n", "1.0 | \n", "True | \n", "231.0 | \n", "251.0 | \n", "275.0 | \n", "213.0 | \n", "131.534 | \n", "
| 5 | \n", "2021-01-01 00:50:04.721 | \n", "2021 | \n", "Bahrain Grand Prix | \n", "Race | \n", "GAS | \n", "AlphaTauri | \n", "6.0 | \n", "0 days 00:01:36.677000 | \n", "0 days 00:00:30.990000 | \n", "0 days 00:00:41.802000 | \n", "0 days 00:00:23.885000 | \n", "HARD | \n", "2.0 | \n", "True | \n", "233.0 | \n", "254.0 | \n", "275.0 | \n", "280.0 | \n", "96.677 | \n", "
| 6 | \n", "2021-01-01 00:51:41.675 | \n", "2021 | \n", "Bahrain Grand Prix | \n", "Race | \n", "GAS | \n", "AlphaTauri | \n", "7.0 | \n", "0 days 00:01:36.954000 | \n", "0 days 00:00:31.176000 | \n", "0 days 00:00:41.678000 | \n", "0 days 00:00:24.100000 | \n", "HARD | \n", "3.0 | \n", "True | \n", "232.0 | \n", "252.0 | \n", "274.0 | \n", "282.0 | \n", "96.954 | \n", "
| 8 | \n", "2021-01-01 00:54:56.129 | \n", "2021 | \n", "Bahrain Grand Prix | \n", "Race | \n", "GAS | \n", "AlphaTauri | \n", "9.0 | \n", "0 days 00:01:37.030000 | \n", "0 days 00:00:31.256000 | \n", "0 days 00:00:41.911000 | \n", "0 days 00:00:23.863000 | \n", "HARD | \n", "5.0 | \n", "True | \n", "234.0 | \n", "248.0 | \n", "276.0 | \n", "286.0 | \n", "97.030 | \n", "