{"metadata":{"kaggle":{"accelerator":"gpu","dataSources":[{"sourceId":82611,"databundleVersionId":9553358,"sourceType":"competition"}],"dockerImageVersionId":30786,"isInternetEnabled":true,"language":"python","sourceType":"notebook","isGpuEnabled":true},"kernelspec":{"name":"python3","display_name":"Python 3","language":"python"},"language_info":{"name":"python","version":"3.10.14","mimetype":"text/x-python","codemirror_mode":{"name":"ipython","version":3},"pygments_lexer":"ipython3","nbconvert_exporter":"python","file_extension":".py"}},"nbformat_minor":4,"nbformat":4,"cells":[{"cell_type":"code","source":"# Import necessary libraries\nimport pandas as pd\nimport logging\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom sklearn.model_selection import train_test_split\nfrom sklearn.metrics import mean_squared_error\nimport warnings\nwarnings.filterwarnings('ignore')","metadata":{"execution":{"iopub.status.busy":"2024-11-20T09:17:12.141232Z","iopub.execute_input":"2024-11-20T09:17:12.141599Z","iopub.status.idle":"2024-11-20T09:17:12.146568Z","shell.execute_reply.started":"2024-11-20T09:17:12.141567Z","shell.execute_reply":"2024-11-20T09:17:12.145662Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# Loading dataset\ntrain = pd.read_csv(\"/kaggle/input/brist1d/train.csv\", low_memory=False)\ntest = pd.read_csv(\"/kaggle/input/brist1d/test.csv\", low_memory=False)\nsample = pd.read_csv(\"/kaggle/input/brist1d/sample_submission.csv\", low_memory=False)","metadata":{"execution":{"iopub.status.busy":"2024-11-20T09:17:12.148094Z","iopub.execute_input":"2024-11-20T09:17:12.148385Z","iopub.status.idle":"2024-11-20T09:17:30.641200Z","shell.execute_reply.started":"2024-11-20T09:17:12.148360Z","shell.execute_reply":"2024-11-20T09:17:30.640542Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train.head()","metadata":{"execution":{"iopub.status.busy":"2024-11-20T09:17:30.642346Z","iopub.execute_input":"2024-11-20T09:17:30.642705Z","iopub.status.idle":"2024-11-20T09:17:30.672754Z","shell.execute_reply.started":"2024-11-20T09:17:30.642668Z","shell.execute_reply":"2024-11-20T09:17:30.671926Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train.info()","metadata":{"execution":{"iopub.status.busy":"2024-11-20T09:17:30.674336Z","iopub.execute_input":"2024-11-20T09:17:30.674612Z","iopub.status.idle":"2024-11-20T09:17:30.706333Z","shell.execute_reply.started":"2024-11-20T09:17:30.674586Z","shell.execute_reply":"2024-11-20T09:17:30.705549Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"test.info()","metadata":{"execution":{"iopub.status.busy":"2024-11-20T09:17:30.707325Z","iopub.execute_input":"2024-11-20T09:17:30.707673Z","iopub.status.idle":"2024-11-20T09:17:30.731160Z","shell.execute_reply.started":"2024-11-20T09:17:30.707646Z","shell.execute_reply":"2024-11-20T09:17:30.730428Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"\n# Assuming train is a DataFrame\nmapping_dict = {p: idx for idx, p in enumerate(train['p_num'].unique())}\n\n# Map p_num and process time directly\ntrain['p_num'] = train['p_num'].map(mapping_dict)\ntrain['time'] = pd.to_datetime(train['time'], format='%H:%M:%S').dt.time\n#train['hour'] = train['time'].dt.hour\n#train['minute'] = train['time'].dt.minute\n#train.drop('time', axis=1, inplace=True)\n\n# Drop the 'id' column if it exists\nif 'id' in train.columns:\n    train.drop(columns=['id'], inplace=True)\n\n# Output the processed DataFrame for verification\ntrain.head()\n","metadata":{"execution":{"iopub.status.busy":"2024-11-20T09:17:30.732221Z","iopub.execute_input":"2024-11-20T09:17:30.732899Z","iopub.status.idle":"2024-11-20T09:17:31.149330Z","shell.execute_reply.started":"2024-11-20T09:17:30.732861Z","shell.execute_reply":"2024-11-20T09:17:31.148556Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# If your `time` column is of type datetime.time, convert it to seconds since midnight\ndef time_to_seconds(time):\n    return time.hour * 3600 + time.minute * 60 + time.second","metadata":{"execution":{"iopub.status.busy":"2024-11-20T09:17:31.150655Z","iopub.execute_input":"2024-11-20T09:17:31.151321Z","iopub.status.idle":"2024-11-20T09:17:31.155521Z","shell.execute_reply.started":"2024-11-20T09:17:31.151280Z","shell.execute_reply":"2024-11-20T09:17:31.154663Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"\n# Apply this function to your time-related column\ntrain.loc[:, 'time_in_seconds'] = train['time'].apply(time_to_seconds)\n\n\n# Ensure that the 'time_in_seconds' column is of type int\ntrain.loc[:, 'time_in_seconds'] = train['time_in_seconds'].astype(int)\n\n\n# Remove the original 'time' column if no longer needed\ntrain = train.drop(columns=['time'])\n\n\n\n# Now, verify the types again\nprint(train.dtypes)  # Should show 'time_in_seconds' as int","metadata":{"execution":{"iopub.status.busy":"2024-11-20T09:17:31.156655Z","iopub.execute_input":"2024-11-20T09:17:31.156981Z","iopub.status.idle":"2024-11-20T09:17:31.554389Z","shell.execute_reply.started":"2024-11-20T09:17:31.156955Z","shell.execute_reply":"2024-11-20T09:17:31.553453Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"import pandas as pd\n\n# Assuming train is a DataFrame\nmapping_dict = {p: idx for idx, p in enumerate(test['p_num'].unique())}\n\n# Map p_num and process time directly\ntest['p_num'] = test['p_num'].map(mapping_dict)\ntest['time'] = pd.to_datetime(test['time'], format='%H:%M:%S').dt.time\n#test['hour'] = test['time'].dt.hour\n#test['minute'] = test['time'].dt.minute\n#test.drop('time', axis=1, inplace=True)\n\nif 'id' in test.columns:\n    test.drop(columns=['id'], inplace=True)\n","metadata":{"execution":{"iopub.status.busy":"2024-11-20T09:17:31.555378Z","iopub.execute_input":"2024-11-20T09:17:31.555648Z","iopub.status.idle":"2024-11-20T09:17:31.576201Z","shell.execute_reply.started":"2024-11-20T09:17:31.555621Z","shell.execute_reply":"2024-11-20T09:17:31.575290Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"\n# Apply this function to your time-related column\ntest.loc[:, 'time_in_seconds'] = test['time'].apply(time_to_seconds)\n\n\n# Ensure that the 'time_in_seconds' column is of type int\ntest.loc[:, 'time_in_seconds'] = test['time_in_seconds'].astype(int)\n\n\n# Remove the original 'time' column if no longer needed\ntest = test.drop(columns=['time'])\n\n\n\n# Now, verify the types again\nprint(test.dtypes)  # Should show 'time_in_seconds' as int","metadata":{"execution":{"iopub.status.busy":"2024-11-20T09:17:31.579442Z","iopub.execute_input":"2024-11-20T09:17:31.579766Z","iopub.status.idle":"2024-11-20T09:17:31.598886Z","shell.execute_reply.started":"2024-11-20T09:17:31.579738Z","shell.execute_reply":"2024-11-20T09:17:31.597852Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train.head(5)","metadata":{"execution":{"iopub.status.busy":"2024-11-20T09:17:31.599777Z","iopub.execute_input":"2024-11-20T09:17:31.600010Z","iopub.status.idle":"2024-11-20T09:17:31.617983Z","shell.execute_reply.started":"2024-11-20T09:17:31.599988Z","shell.execute_reply":"2024-11-20T09:17:31.617214Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"def drop_columns_with_high_nan(df, threshold=0.25):\n    \"\"\"\n    Drops columns from the DataFrame if they have more than a specified\n    percentage of missing values and returns the names of these columns.\n\n    Parameters:\n        df (pd.DataFrame): The input DataFrame.\n        threshold (float): The percentage threshold for missing values (default is 0.25 for 25%).\n\n    Returns:\n        tuple: \n            - pd.DataFrame: The DataFrame with columns having more than `threshold`% missing values dropped.\n            - list: Names of the columns that were dropped.\n    \"\"\"\n    # Calculate the threshold count for missing values\n    missing_threshold = len(df) * threshold\n\n    # Identify columns with more missing values than the threshold\n    high_nan_columns = df.columns[df.isnull().sum() > missing_threshold].tolist()\n\n    # Drop the identified columns\n    cleaned_df = df.drop(columns=high_nan_columns)\n\n    return cleaned_df, high_nan_columns\n","metadata":{"execution":{"iopub.status.busy":"2024-11-20T09:17:31.619226Z","iopub.execute_input":"2024-11-20T09:17:31.620111Z","iopub.status.idle":"2024-11-20T09:17:31.626675Z","shell.execute_reply.started":"2024-11-20T09:17:31.620060Z","shell.execute_reply":"2024-11-20T09:17:31.625923Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# Apply the function\ntrain_cleaned, dropped_columns = drop_columns_with_high_nan(train, threshold=0.25)\n\n\nprint(\"\\nDropped Columns:\")\nprint(dropped_columns)\n\nprint(\"Cleaned DataFrame:\")\ntrain_cleaned.head()","metadata":{"execution":{"iopub.status.busy":"2024-11-20T09:17:31.627915Z","iopub.execute_input":"2024-11-20T09:17:31.628551Z","iopub.status.idle":"2024-11-20T09:17:32.147337Z","shell.execute_reply.started":"2024-11-20T09:17:31.628513Z","shell.execute_reply":"2024-11-20T09:17:32.146345Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"\n\ndef apply_column_removal_to_test(train_df, test_df, threshold=0.25):\n    \"\"\"\n    Applies column removal based on NaN threshold from train data to test data.\n    \n    Parameters:\n        train_df (pd.DataFrame): The training DataFrame.\n        test_df (pd.DataFrame): The test DataFrame.\n        threshold (float): The percentage threshold for missing values (default is 0.25 for 25%).\n\n    Returns:\n        tuple:\n            - pd.DataFrame: Cleaned test DataFrame with columns dropped.\n            - list: Names of the columns dropped from the test data.\n    \"\"\"\n    # Drop columns in train data and get the names of dropped columns\n    _, high_nan_columns_train = drop_columns_with_high_nan(train_df, threshold)\n\n    # Remove the same columns from test data\n    cleaned_test_df = test_df.drop(columns=high_nan_columns_train, errors='ignore')\n\n    return cleaned_test_df, high_nan_columns_train\n","metadata":{"execution":{"iopub.status.busy":"2024-11-20T09:17:32.148280Z","iopub.execute_input":"2024-11-20T09:17:32.148538Z","iopub.status.idle":"2024-11-20T09:17:32.153336Z","shell.execute_reply.started":"2024-11-20T09:17:32.148504Z","shell.execute_reply":"2024-11-20T09:17:32.152335Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# Apply the function\ntest_cleaned, dropped_columns = apply_column_removal_to_test(train, test, threshold=0.25)\n\n\n\nprint(\"\\nDropped Columns from Test Data:\")\nprint(dropped_columns)\n\nprint(\"Cleaned Test DataFrame:\")\ntest_cleaned.head()","metadata":{"execution":{"iopub.status.busy":"2024-11-20T09:17:32.154326Z","iopub.execute_input":"2024-11-20T09:17:32.154613Z","iopub.status.idle":"2024-11-20T09:17:32.692228Z","shell.execute_reply.started":"2024-11-20T09:17:32.154587Z","shell.execute_reply":"2024-11-20T09:17:32.691393Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"print(\"Updated df_train:\",train_cleaned.shape)\nprint(\"Updated df_test:\",test_cleaned.shape)","metadata":{"execution":{"iopub.status.busy":"2024-11-20T09:17:32.693296Z","iopub.execute_input":"2024-11-20T09:17:32.693595Z","iopub.status.idle":"2024-11-20T09:17:32.698046Z","shell.execute_reply.started":"2024-11-20T09:17:32.693568Z","shell.execute_reply":"2024-11-20T09:17:32.697108Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"def check_missing_values(df):\n    return pd.DataFrame({\n        'Missing Values': df.isna().sum(),\n        'Percentage (%)': (df.isna().mean() * 100)\n    })","metadata":{"execution":{"iopub.status.busy":"2024-11-20T09:17:32.699111Z","iopub.execute_input":"2024-11-20T09:17:32.699345Z","iopub.status.idle":"2024-11-20T09:17:32.708009Z","shell.execute_reply.started":"2024-11-20T09:17:32.699324Z","shell.execute_reply":"2024-11-20T09:17:32.707223Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"missing_info = check_missing_values(train_cleaned)\nprint(missing_info)","metadata":{"execution":{"iopub.status.busy":"2024-11-20T09:17:32.709017Z","iopub.execute_input":"2024-11-20T09:17:32.709839Z","iopub.status.idle":"2024-11-20T09:17:32.833506Z","shell.execute_reply.started":"2024-11-20T09:17:32.709811Z","shell.execute_reply":"2024-11-20T09:17:32.832694Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"missing_info = check_missing_values(test_cleaned)\nprint(missing_info)","metadata":{"execution":{"iopub.status.busy":"2024-11-20T09:17:32.834617Z","iopub.execute_input":"2024-11-20T09:17:32.834963Z","iopub.status.idle":"2024-11-20T09:17:32.845018Z","shell.execute_reply.started":"2024-11-20T09:17:32.834924Z","shell.execute_reply":"2024-11-20T09:17:32.844147Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# Identify columns with all missing values\nall_missing_columns = train_cleaned.columns[train_cleaned.isnull().all()]\nprint(\"Columns with all missing values:\", all_missing_columns)\n\n# Drop entirely missing columns\ntrain_cleaned = train_cleaned.drop(columns=all_missing_columns)\n","metadata":{"execution":{"iopub.status.busy":"2024-11-20T09:17:32.846099Z","iopub.execute_input":"2024-11-20T09:17:32.846362Z","iopub.status.idle":"2024-11-20T09:17:32.979266Z","shell.execute_reply.started":"2024-11-20T09:17:32.846336Z","shell.execute_reply":"2024-11-20T09:17:32.978523Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"def check_same_columns(train_df, test_df):\n    \"\"\"\n    Checks if train and test DataFrames have the same columns.\n    \n    Parameters:\n        train_df (pd.DataFrame): Training DataFrame.\n        test_df (pd.DataFrame): Testing DataFrame.\n        \n    Returns:\n        bool: True if both DataFrames have the same columns, False otherwise.\n        list: List of columns not in both DataFrames.\n    \"\"\"\n    # Get columns present in each DataFrame\n    train_columns = set(train_df.columns)\n    test_columns = set(test_df.columns)\n    \n    # Find columns that are not common in both\n    missing_in_train = test_columns - train_columns\n    missing_in_test = train_columns - test_columns\n    \n    # Check if both sets of columns are equal\n    if train_columns == test_columns:\n        print(\"Train and test DataFrames have the same columns.\")\n        return True, []\n    else:\n        print(\"Train and test DataFrames do not have the same columns.\")\n        print(\"Columns missing in train:\", missing_in_train)\n        print(\"Columns missing in test:\", missing_in_test)\n        return False, list(missing_in_train | missing_in_test)","metadata":{"execution":{"iopub.status.busy":"2024-11-20T09:17:32.980676Z","iopub.execute_input":"2024-11-20T09:17:32.981154Z","iopub.status.idle":"2024-11-20T09:17:32.986786Z","shell.execute_reply.started":"2024-11-20T09:17:32.981116Z","shell.execute_reply":"2024-11-20T09:17:32.985955Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# Check columns\nsame_columns, diff_columns = check_same_columns(train_cleaned, test_cleaned)\nprint(\"\\nColumns that differ:\", diff_columns)","metadata":{"execution":{"iopub.status.busy":"2024-11-20T09:17:32.987892Z","iopub.execute_input":"2024-11-20T09:17:32.988636Z","iopub.status.idle":"2024-11-20T09:17:33.001514Z","shell.execute_reply.started":"2024-11-20T09:17:32.988598Z","shell.execute_reply":"2024-11-20T09:17:33.000746Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"import pandas as pd\n\ndef reduce_memory_usage(df):\n    \"\"\"\n    Reduces memory usage of a DataFrame by downcasting numerical columns\n    and converting object columns to categorical where possible.\n    \n    Parameters:\n        df (pd.DataFrame): The input DataFrame.\n        \n    Returns:\n        pd.DataFrame: DataFrame with optimized memory usage.\n    \"\"\"\n    start_mem = df.memory_usage().sum() / 1024**2  # Memory usage in MB\n    print(f\"Initial memory usage of DataFrame: {start_mem:.2f} MB\")\n\n    # Iterate over each column to reduce memory usage\n    for col in df.columns:\n        col_type = df[col].dtype\n        \n        if col_type == 'int64':\n            df[col] = pd.to_numeric(df[col], downcast='integer')\n        elif col_type == 'float64':\n            df[col] = pd.to_numeric(df[col], downcast='float')\n        elif col_type == 'object' and df[col].nunique() < 0.5 * len(df):\n            df[col] = df[col].astype('category')\n\n    end_mem = df.memory_usage().sum() / 1024**2  # Memory usage after optimization\n    print(f\"Reduced memory usage of DataFrame: {end_mem:.2f} MB ({100 * (start_mem - end_mem) / start_mem:.2f}% reduction)\")\n    \n    return df\n","metadata":{"execution":{"iopub.status.busy":"2024-11-20T09:17:33.002407Z","iopub.execute_input":"2024-11-20T09:17:33.002686Z","iopub.status.idle":"2024-11-20T09:17:33.011313Z","shell.execute_reply.started":"2024-11-20T09:17:33.002661Z","shell.execute_reply":"2024-11-20T09:17:33.010518Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# Assuming your data is in train_cleaned and test_cleaned\ntrain_cleaned = reduce_memory_usage(train_cleaned)\ntest_cleaned = reduce_memory_usage(test_cleaned)\n","metadata":{"execution":{"iopub.status.busy":"2024-11-20T09:17:33.012227Z","iopub.execute_input":"2024-11-20T09:17:33.012496Z","iopub.status.idle":"2024-11-20T09:17:33.850433Z","shell.execute_reply.started":"2024-11-20T09:17:33.012440Z","shell.execute_reply":"2024-11-20T09:17:33.849590Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"import pandas as pd\nimport logging\n\n# Set up logging configuration\nlogging.basicConfig(level=logging.DEBUG, format='%(asctime)s - %(levelname)s - %(message)s')\n\ndef summarize_columns_rolling_mean(df, column_prefix, window_size=3):\n    \"\"\"\n    Summarizes columns by computing the rolling mean over specified intervals.\n    \n    Parameters:\n    - df: DataFrame containing the data.\n    - column_prefix: Prefix of the columns to summarize (e.g., 'bg').\n    - window_size: Number of columns to group together for mean calculation.\n    \n    Returns:\n    - DataFrame with summarized columns by rolling mean.\n    \"\"\"\n    logging.info(f\"Summarizing columns starting with {column_prefix} using rolling mean (window size: {window_size})\")\n    \n    # Find all columns starting with the specified prefix\n    columns = [col for col in df.columns if col.startswith(column_prefix)]\n    \n    new_column_data = {}\n    \n    for i in range(len(columns) // window_size):\n        cols_to_mean = columns[i * window_size:(i + 1) * window_size]\n        \n        mean_value = df[cols_to_mean].mean(axis=1)\n        new_column_name = f\"{cols_to_mean[-1]}\"\n        new_column_data[new_column_name] = mean_value\n    \n    summarized_df = pd.DataFrame(new_column_data)\n    logging.info(f\"Created summarized DataFrame with rolling mean columns\")\n    \n    df = df.drop(columns=columns, errors='ignore')\n    df = pd.concat([df, summarized_df], axis=1)\n    \n    logging.info(f\"Updated DataFrame after summarization of {column_prefix}\")\n    return df","metadata":{"execution":{"iopub.status.busy":"2024-11-20T09:17:33.851671Z","iopub.execute_input":"2024-11-20T09:17:33.852295Z","iopub.status.idle":"2024-11-20T09:17:33.859319Z","shell.execute_reply.started":"2024-11-20T09:17:33.852256Z","shell.execute_reply":"2024-11-20T09:17:33.858388Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"def summarize_columns_sum(df, column_prefix, window_size=3):\n    \"\"\"\n    Summarizes columns by computing the sum over specified intervals.\n    \n    Parameters:\n    - df: DataFrame containing the data.\n    - column_prefix: Prefix of the columns to summarize (e.g., 'insulin').\n    - window_size: Number of columns to group together for sum calculation.\n    \n    Returns:\n    - DataFrame with summarized columns by sum.\n    \"\"\"\n    logging.info(f\"Summarizing columns starting with {column_prefix} using sum (window size: {window_size})\")\n    \n    columns = [col for col in df.columns if col.startswith(column_prefix)]\n    \n    new_column_data = {}\n    \n    for i in range(len(columns) // window_size):\n        cols_to_sum = columns[i * window_size:(i + 1) * window_size]\n        \n        sum_value = df[cols_to_sum].sum(axis=1)\n        new_column_name = f\"{cols_to_sum[-1]}\"\n        new_column_data[new_column_name] = sum_value\n    \n    summarized_df = pd.DataFrame(new_column_data)\n    logging.info(f\"Created summarized DataFrame with sum columns\")\n    \n    df = df.drop(columns=columns, errors='ignore')\n    df = pd.concat([df, summarized_df], axis=1)\n    \n    logging.info(f\"Updated DataFrame after summarization of {column_prefix}\")\n    return df","metadata":{"execution":{"iopub.status.busy":"2024-11-20T09:17:33.860458Z","iopub.execute_input":"2024-11-20T09:17:33.860860Z","iopub.status.idle":"2024-11-20T09:17:33.873142Z","shell.execute_reply.started":"2024-11-20T09:17:33.860800Z","shell.execute_reply":"2024-11-20T09:17:33.872254Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"def summarize_all_columns(df):\n    logging.info(\"Starting summarization of all columns\")\n    \n    df = summarize_columns_rolling_mean(df, column_prefix='bg-', window_size=3)\n    df = summarize_columns_sum(df, column_prefix='insulin', window_size=3)\n    df = summarize_columns_sum(df, column_prefix='carbs', window_size=3)\n    df = summarize_columns_rolling_mean(df, column_prefix='hr', window_size=3)\n    df = summarize_columns_sum(df, column_prefix='steps', window_size=3)\n    df = summarize_columns_sum(df, column_prefix='cals', window_size=3)\n    \n    logging.info(\"Completed summarization of all columns\")\n    return df","metadata":{"execution":{"iopub.status.busy":"2024-11-20T09:17:33.874145Z","iopub.execute_input":"2024-11-20T09:17:33.874365Z","iopub.status.idle":"2024-11-20T09:17:33.886556Z","shell.execute_reply.started":"2024-11-20T09:17:33.874343Z","shell.execute_reply":"2024-11-20T09:17:33.885754Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train_df = summarize_all_columns(train_cleaned)","metadata":{"execution":{"iopub.status.busy":"2024-11-20T09:17:33.891942Z","iopub.execute_input":"2024-11-20T09:17:33.892218Z","iopub.status.idle":"2024-11-20T09:17:36.277543Z","shell.execute_reply.started":"2024-11-20T09:17:33.892191Z","shell.execute_reply":"2024-11-20T09:17:36.276528Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train_df","metadata":{"execution":{"iopub.status.busy":"2024-11-20T09:17:36.278902Z","iopub.execute_input":"2024-11-20T09:17:36.279254Z","iopub.status.idle":"2024-11-20T09:17:36.319511Z","shell.execute_reply.started":"2024-11-20T09:17:36.279215Z","shell.execute_reply":"2024-11-20T09:17:36.318687Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"test_df = summarize_all_columns(test_cleaned)","metadata":{"execution":{"iopub.status.busy":"2024-11-20T09:17:36.320612Z","iopub.execute_input":"2024-11-20T09:17:36.320885Z","iopub.status.idle":"2024-11-20T09:17:36.437983Z","shell.execute_reply.started":"2024-11-20T09:17:36.320858Z","shell.execute_reply":"2024-11-20T09:17:36.437190Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"test_df","metadata":{"execution":{"iopub.status.busy":"2024-11-20T09:17:36.439017Z","iopub.execute_input":"2024-11-20T09:17:36.439273Z","iopub.status.idle":"2024-11-20T09:17:36.461219Z","shell.execute_reply.started":"2024-11-20T09:17:36.439247Z","shell.execute_reply":"2024-11-20T09:17:36.460510Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train_df.info()","metadata":{"execution":{"iopub.status.busy":"2024-11-20T09:17:36.462071Z","iopub.execute_input":"2024-11-20T09:17:36.462313Z","iopub.status.idle":"2024-11-20T09:17:36.487657Z","shell.execute_reply.started":"2024-11-20T09:17:36.462289Z","shell.execute_reply":"2024-11-20T09:17:36.486776Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"from sklearn.impute import KNNImputer\nimport pandas as pd\n\ndef knn_imputation(df, n_neighbors=5):\n    \"\"\"\n    Impute missing values for all columns using k-NN.\n    \n    Parameters:\n        df (pd.DataFrame): The DataFrame with missing values.\n        n_neighbors (int): Number of neighbors to consider for k-NN imputation.\n        \n    Returns:\n        pd.DataFrame: DataFrame with missing values imputed using k-NN.\n    \"\"\"\n    \n    # Initialize the KNNImputer\n    knn_imputer = KNNImputer(n_neighbors=n_neighbors)\n    \n    # Apply k-NN imputation to the entire DataFrame\n    df_imputed = pd.DataFrame(\n        knn_imputer.fit_transform(df), \n        columns=df.columns,\n        index=df.index\n    )\n    \n    return df_imputed\n","metadata":{"execution":{"iopub.status.busy":"2024-11-20T09:17:36.488630Z","iopub.execute_input":"2024-11-20T09:17:36.488875Z","iopub.status.idle":"2024-11-20T09:17:36.614921Z","shell.execute_reply.started":"2024-11-20T09:17:36.488851Z","shell.execute_reply":"2024-11-20T09:17:36.614232Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# Apply custom imputation to train and test DataFrames\n#train_imputed = knn_imputation_in_batches(train_cleaned)\n#test_imputed = custom_imputation(test_cleaned)\n\n\n# Apply k-NN imputation\nimputed_train_df = knn_imputation(train_df, n_neighbors=2)\nimputed_train_df","metadata":{"execution":{"iopub.status.busy":"2024-11-20T09:17:36.616030Z","iopub.execute_input":"2024-11-20T09:17:36.616382Z","iopub.status.idle":"2024-11-20T09:26:45.606496Z","shell.execute_reply.started":"2024-11-20T09:17:36.616344Z","shell.execute_reply":"2024-11-20T09:26:45.605375Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# Apply k-NN imputation\nimputed_test_df = knn_imputation(test_df, n_neighbors=2)\nimputed_test_df","metadata":{"execution":{"iopub.status.busy":"2024-11-20T09:26:45.607786Z","iopub.execute_input":"2024-11-20T09:26:45.608150Z","iopub.status.idle":"2024-11-20T09:26:45.927566Z","shell.execute_reply.started":"2024-11-20T09:26:45.608111Z","shell.execute_reply":"2024-11-20T09:26:45.926549Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"imputed_train_df.isnull().sum()","metadata":{"execution":{"iopub.status.busy":"2024-11-20T09:26:45.928464Z","iopub.execute_input":"2024-11-20T09:26:45.928796Z","iopub.status.idle":"2024-11-20T09:26:45.957365Z","shell.execute_reply.started":"2024-11-20T09:26:45.928770Z","shell.execute_reply":"2024-11-20T09:26:45.956283Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"imputed_test_df.isnull().sum()","metadata":{"execution":{"iopub.status.busy":"2024-11-20T09:26:45.958436Z","iopub.execute_input":"2024-11-20T09:26:45.958952Z","iopub.status.idle":"2024-11-20T09:26:45.967028Z","shell.execute_reply.started":"2024-11-20T09:26:45.958925Z","shell.execute_reply":"2024-11-20T09:26:45.966132Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# Calculate Q1, Q3, and IQR\nQ1 = imputed_train_df[\"bg+1:00\"].quantile(0.25)\nQ3 = imputed_train_df[\"bg+1:00\"].quantile(0.75)\nIQR = Q3 - Q1\n\n# Define bounds for outliers\nlower_bound = Q1 - 1.5 * IQR\nupper_bound = Q3 + 1.5 * IQR\n\n# Drop rows with target values outside the bounds\ntrain_df = imputed_train_df[(imputed_train_df[\"bg+1:00\"] >= lower_bound) & (imputed_train_df[\"bg+1:00\"] <= upper_bound)]\n","metadata":{"execution":{"iopub.status.busy":"2024-11-20T10:02:10.188899Z","iopub.execute_input":"2024-11-20T10:02:10.189233Z","iopub.status.idle":"2024-11-20T10:02:10.238090Z","shell.execute_reply.started":"2024-11-20T10:02:10.189204Z","shell.execute_reply":"2024-11-20T10:02:10.237315Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train_df","metadata":{"execution":{"iopub.status.busy":"2024-11-20T10:02:50.769084Z","iopub.execute_input":"2024-11-20T10:02:50.769424Z","iopub.status.idle":"2024-11-20T10:02:50.807477Z","shell.execute_reply.started":"2024-11-20T10:02:50.769392Z","shell.execute_reply":"2024-11-20T10:02:50.806633Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"X = train_df.drop('bg+1:00', axis=1)\ny = train_df['bg+1:00']","metadata":{"execution":{"iopub.status.busy":"2024-11-20T10:03:11.104976Z","iopub.execute_input":"2024-11-20T10:03:11.105716Z","iopub.status.idle":"2024-11-20T10:03:11.143198Z","shell.execute_reply.started":"2024-11-20T10:03:11.105681Z","shell.execute_reply":"2024-11-20T10:03:11.142422Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"X_train, x_val, y_train, y_val = train_test_split(X, y, test_size = 0.2 , random_state = 42)","metadata":{"execution":{"iopub.status.busy":"2024-11-20T10:03:11.506845Z","iopub.execute_input":"2024-11-20T10:03:11.507596Z","iopub.status.idle":"2024-11-20T10:03:11.608773Z","shell.execute_reply.started":"2024-11-20T10:03:11.507563Z","shell.execute_reply":"2024-11-20T10:03:11.607974Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"import xgboost as xgb\nimport pandas as pd\nimport numpy as np\nfrom sklearn.model_selection import train_test_split\n\n\n\n# Initialize and train the XGBoost model\nmodel = xgb.XGBRegressor()\nmodel.fit(X_train, y_train)\n\n# Retrieve feature importance scores\nimportance_types = ['weight', 'gain', 'cover']\nfeature_importances = {}\n\nfor importance_type in importance_types:\n    feature_importances[importance_type] = model.get_booster().get_score(importance_type=importance_type)\n\n# Convert to DataFrame for easier viewing\nimportance_df = pd.DataFrame(feature_importances).fillna(0)\nimportance_df['Feature'] = X_train.columns\nimportance_df = importance_df.set_index('Feature')\n\n# Sort features by one of the importance metrics (e.g., 'gain')\nsorted_features = importance_df.sort_values(by='gain', ascending=False)\n\n# Set a threshold to select features\nthreshold = 25\nselected_features = sorted_features[sorted_features['weight'] > threshold]\n\n# Display selected features\nprint(\"Selected Features from XGBoost Importance:\")\nprint(selected_features)\n\n\n","metadata":{"execution":{"iopub.status.busy":"2024-11-20T10:03:12.558463Z","iopub.execute_input":"2024-11-20T10:03:12.559380Z","iopub.status.idle":"2024-11-20T10:03:15.541353Z","shell.execute_reply.started":"2024-11-20T10:03:12.559347Z","shell.execute_reply":"2024-11-20T10:03:15.540635Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# Filter the train and validation sets to use only selected features\nX_train_selected = X_train[selected_features.index]\nx_val_selected = x_val[selected_features.index]","metadata":{"execution":{"iopub.status.busy":"2024-11-20T10:03:15.542435Z","iopub.execute_input":"2024-11-20T10:03:15.542718Z","iopub.status.idle":"2024-11-20T10:03:15.577880Z","shell.execute_reply.started":"2024-11-20T10:03:15.542692Z","shell.execute_reply":"2024-11-20T10:03:15.576745Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"print(X_train_selected.columns)\nprint(len(X_train_selected.columns))","metadata":{"execution":{"iopub.status.busy":"2024-11-20T10:03:19.990135Z","iopub.execute_input":"2024-11-20T10:03:19.990875Z","iopub.status.idle":"2024-11-20T10:03:19.996059Z","shell.execute_reply.started":"2024-11-20T10:03:19.990839Z","shell.execute_reply":"2024-11-20T10:03:19.995092Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"from sklearn.preprocessing import StandardScaler\n\n# Initialize the scaler\nscaler = StandardScaler()\n\n# Fit the scaler on the training data and transform it\nX_train_scaled = scaler.fit_transform(X_train_selected)\n\n# Transform the validation or test data using the already-fitted scaler\nX_val_scaled = scaler.transform(x_val_selected)\n","metadata":{"execution":{"iopub.status.busy":"2024-11-20T10:03:21.195641Z","iopub.execute_input":"2024-11-20T10:03:21.195983Z","iopub.status.idle":"2024-11-20T10:03:21.339859Z","shell.execute_reply.started":"2024-11-20T10:03:21.195954Z","shell.execute_reply":"2024-11-20T10:03:21.338727Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"import matplotlib.pyplot as plt\nfrom sklearn.model_selection import KFold\nfrom sklearn.metrics import mean_squared_error, mean_absolute_error, r2_score\nfrom sklearn.preprocessing import StandardScaler\nimport numpy as np\nimport xgboost as xgb\nfrom xgboost import XGBRegressor\nimport pickle  \n# Set up K-Fold Cross Validation\nkf = KFold(n_splits=5, shuffle=True)\n\n# Lists to store metrics for each fold\nrmse_scores = []\nmae_scores = []\nr2_scores = []\nall_residuals = [] \n\n# Initialize variable to store the best model\nbest_model = None\nbest_rmse = float('inf') \n\nfold = 1  # Counter for folds\n\n# Create figure to plot RMSE across epochs for each fold\nplt.figure(figsize=(10, 6))\n\n# Perform k-fold cross-validation\nfor train_index, val_index in kf.split(X_train_scaled):\n    # Split data into train and validation sets for the current fold\n    X_train_fold, X_val_fold = X_train_scaled[train_index], X_train_scaled[val_index]\n    y_train_fold, y_val_fold = y_train.iloc[train_index], y_train.iloc[val_index]\n  \n    # Initialize model with best parameters\n    model =  XGBRegressor(\n    objective='reg:squarederror', \n    n_estimators= 10000,\n    device='cuda',\n    random_state = 42,\n    learning_rate = 0.075,\n    max_depth= 10,  \n    tree_method='gpu_hist')\n    \n    print(f\"Training Fold {fold}...\")\n    \n    # Train the model on the current fold’s data\n    model.fit(X_train_fold, y_train_fold, eval_set=[(X_val_fold, y_val_fold)], \n              eval_metric=\"rmse\", early_stopping_rounds=100, verbose=2000)\n    \n    # Retrieve RMSE during training\n    eval_results = model.evals_result()\n    epochs = len(eval_results['validation_0']['rmse'])\n    rmse_per_epoch = eval_results['validation_0']['rmse']\n    \n    # Plot RMSE per epoch for this fold\n    plt.plot(range(epochs), rmse_per_epoch, label=f'Fold {fold} RMSE')\n    \n    # Make predictions on the validation data for this fold\n    y_pred = model.predict(X_val_fold)\n    \n    # Calculate evaluation metrics\n    rmse = np.sqrt(mean_squared_error(y_val_fold, y_pred))\n    mae = mean_absolute_error(y_val_fold, y_pred)\n    r2 = r2_score(y_val_fold, y_pred)\n    \n    # Calculate residuals\n    residuals = y_val_fold - y_pred\n    all_residuals.extend(residuals) \n    \n    # Append metrics for later\n    rmse_scores.append(rmse)\n    mae_scores.append(mae)\n    r2_scores.append(r2)\n    \n    # Track the best model based on RMSE\n    if rmse < best_rmse:\n        best_rmse = rmse\n        best_model = model  # Save the best model\n        \n    fold += 1\n    \n    \n\n# Customize plot for RMSE per epoch\nplt.xlabel(\"Epochs\")\nplt.ylabel(\"RMSE\")\nplt.title(\"RMSE per Epoch for Each Fold\")\nplt.legend()\nplt.show()\n\n# Plot final metrics (MAE, RMSE, R²) across folds\nplt.figure(figsize=(10, 6))\n\n# Plot RMSE across folds\nplt.subplot(1, 3, 1)\nplt.plot(range(1, kf.get_n_splits() + 1), rmse_scores, marker='o')\nplt.title(\"RMSE across Folds\")\nplt.xlabel(\"Fold\")\nplt.ylabel(\"RMSE\")\n\n# Plot MAE across folds\nplt.subplot(1, 3, 2)\nplt.plot(range(1, kf.get_n_splits() + 1), mae_scores, marker='o')\nplt.title(\"MAE across Folds\")\nplt.xlabel(\"Fold\")\nplt.ylabel(\"MAE\")\n\n# Plot R² across folds\nplt.subplot(1, 3, 3)\nplt.plot(range(1, kf.get_n_splits() + 1), r2_scores, marker='o')\nplt.title(\"R² across Folds\")\nplt.xlabel(\"Fold\")\nplt.ylabel(\"R²\")\n\n# Plot combined residuals across all folds\nplt.figure(figsize=(10, 6))\nplt.scatter(range(len(all_residuals)), all_residuals, alpha=0.5)\nplt.axhline(0, color='r', linestyle='--')\nplt.title(\"Combined Residuals Plot Across All Folds\")\nplt.xlabel(\"Sample Index\")\nplt.ylabel(\"Residuals\")\nplt.show()\n\n# Save the best model to a file using pickle\nwith open('best_xgb_model.pkl', 'wb') as f:\n    pickle.dump(best_model, f)\n\nprint(\"Best model saved as 'best_xgb_model.pkl'\")\n\nplt.tight_layout()\nplt.show()\n","metadata":{"execution":{"iopub.status.busy":"2024-11-20T10:03:25.403899Z","iopub.execute_input":"2024-11-20T10:03:25.404532Z","iopub.status.idle":"2024-11-20T10:08:18.670699Z","shell.execute_reply.started":"2024-11-20T10:03:25.404499Z","shell.execute_reply":"2024-11-20T10:08:18.669734Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"import numpy as np\nimport matplotlib.pyplot as plt\nimport scipy.stats as stats\n\n# Assume residuals are stored in a list or array called `residuals`\nresiduals = np.array(all_residuals)  # Replace with your residuals data\n\n# Generate Q-Q plot\nplt.figure(figsize=(8, 6))\nstats.probplot(residuals, dist=\"norm\", plot=plt)\nplt.title(\"Q-Q Plot of Residuals\")\nplt.ylabel(\"Ordered Values\")\nplt.xlabel(\"Theoretical Quantiles\")\nplt.show()\n","metadata":{"execution":{"iopub.status.busy":"2024-11-20T10:10:15.660398Z","iopub.execute_input":"2024-11-20T10:10:15.661065Z","iopub.status.idle":"2024-11-20T10:10:16.097610Z","shell.execute_reply.started":"2024-11-20T10:10:15.661030Z","shell.execute_reply":"2024-11-20T10:10:16.096632Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# Load the saved model using pickle\nwith open('best_xgb_model.pkl', 'rb') as f:\n    best_model = pickle.load(f)\n","metadata":{"execution":{"iopub.status.busy":"2024-11-20T10:10:17.347534Z","iopub.execute_input":"2024-11-20T10:10:17.347900Z","iopub.status.idle":"2024-11-20T10:10:17.951627Z","shell.execute_reply.started":"2024-11-20T10:10:17.347870Z","shell.execute_reply":"2024-11-20T10:10:17.950639Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"y_pred = best_model.predict(X_val_scaled)\nrmse = np.sqrt(mean_squared_error(y_val, y_pred))\nmae = mean_absolute_error(y_val, y_pred)\nr2 = r2_score(y_val, y_pred)\nresiduals = y_val - y_pred\n\nprint(f\"RMSE: {rmse}\")\nprint(f\"MAE: {mae}\")\nprint(f\"R²: {r2}\")\n\nplt.figure(figsize=(10, 6))\nplt.scatter(y_val, residuals, alpha=0.5)\nplt.axhline(y=0, color='r', linestyle='--')  #\nplt.title(\"Residuals Plot\")\nplt.xlabel(\"Actual Values\")\nplt.ylabel(\"Residuals\")\nplt.show()\n","metadata":{"execution":{"iopub.status.busy":"2024-11-20T10:10:26.262279Z","iopub.execute_input":"2024-11-20T10:10:26.263244Z","iopub.status.idle":"2024-11-20T10:10:26.915430Z","shell.execute_reply.started":"2024-11-20T10:10:26.263206Z","shell.execute_reply":"2024-11-20T10:10:26.914526Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"#Visualize Predictions\nplt.figure(figsize=(12, 6))\nplt.plot(y_val.values, label='Actual Glucose Levels')\nplt.plot(y_pred, label='Predicted Glucose Levels')\nplt.xlabel('Samples')\nplt.ylabel('Glucose Level')\nplt.title('Predicted vs Actual Glucose Levels')\nplt.legend()\nplt.show()","metadata":{"execution":{"iopub.status.busy":"2024-11-20T10:10:37.084112Z","iopub.execute_input":"2024-11-20T10:10:37.084813Z","iopub.status.idle":"2024-11-20T10:10:38.619908Z","shell.execute_reply.started":"2024-11-20T10:10:37.084776Z","shell.execute_reply":"2024-11-20T10:10:38.618964Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"## Interference\n","metadata":{}},{"cell_type":"code","source":"\n# Use .loc[] to select columns by name\ntest_selected = imputed_test_df.loc[:, selected_features.index]\n\nprint(test_selected.columns)\nprint(len(test_selected.columns))","metadata":{"execution":{"iopub.status.busy":"2024-11-20T10:10:51.781227Z","iopub.execute_input":"2024-11-20T10:10:51.781865Z","iopub.status.idle":"2024-11-20T10:10:51.788204Z","shell.execute_reply.started":"2024-11-20T10:10:51.781831Z","shell.execute_reply":"2024-11-20T10:10:51.787315Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# Transform the validation or test data using the already-fitted scaler\ntest_scaled = scaler.transform(test_selected)","metadata":{"execution":{"iopub.status.busy":"2024-11-20T10:10:52.776319Z","iopub.execute_input":"2024-11-20T10:10:52.777091Z","iopub.status.idle":"2024-11-20T10:10:52.784066Z","shell.execute_reply.started":"2024-11-20T10:10:52.777054Z","shell.execute_reply":"2024-11-20T10:10:52.783277Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"\ny_test_pred = best_model.predict(test_scaled)\n\n","metadata":{"execution":{"iopub.status.busy":"2024-11-20T10:10:53.158138Z","iopub.execute_input":"2024-11-20T10:10:53.158435Z","iopub.status.idle":"2024-11-20T10:10:53.365423Z","shell.execute_reply.started":"2024-11-20T10:10:53.158409Z","shell.execute_reply":"2024-11-20T10:10:53.364355Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"import pandas as pd\n\n# Assuming you have the 'id' column in your test DataFrame\nsubmission_df = pd.DataFrame({\n    'id': sample['id'],  # Make sure to replace 'test['id']' with the actual name of your ID column if different\n    'bg+1:00': y_test_pred  # Change the column name to match your requirements\n})\n\n# Display the first few rows of the submission DataFrame\nprint(submission_df.head())\n\n# Save to CSV\nsubmission_df.to_csv('submission.csv', index=False)\nprint(f'submission file saved successfully')","metadata":{"execution":{"iopub.status.busy":"2024-11-20T10:10:53.652543Z","iopub.execute_input":"2024-11-20T10:10:53.652880Z","iopub.status.idle":"2024-11-20T10:10:53.667460Z","shell.execute_reply.started":"2024-11-20T10:10:53.652852Z","shell.execute_reply":"2024-11-20T10:10:53.666526Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]}]}