{"metadata":{"kernelspec":{"language":"python","display_name":"Python 3","name":"python3"},"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"},"kaggle":{"accelerator":"none","dataSources":[{"sourceId":82611,"databundleVersionId":9553358,"sourceType":"competition"}],"dockerImageVersionId":30786,"isInternetEnabled":true,"language":"python","sourceType":"notebook","isGpuEnabled":false}},"nbformat_minor":4,"nbformat":4,"cells":[{"cell_type":"code","source":"# This Python 3 environment comes with many helpful analytics libraries installed\n# It is defined by the kaggle/python Docker image: https://github.com/kaggle/docker-python\n# For example, here's several helpful packages to load\n\nimport numpy as np # linear algebra\nimport pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)\n\n# Input data files are available in the read-only \"../input/\" directory\n# For example, running this (by clicking run or pressing Shift+Enter) will list all files under the input directory\n\nimport os\nfor dirname, _, filenames in os.walk('/kaggle/input'):\n    for filename in filenames:\n        print(os.path.join(dirname, filename))\n\n# You can write up to 20GB to the current directory (/kaggle/working/) that gets preserved as output when you create a version using \"Save & Run All\" \n# You can also write temporary files to /kaggle/temp/, but they won't be saved outside of the current session","metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","trusted":true,"execution":{"iopub.status.busy":"2024-11-29T08:39:03.942699Z","iopub.execute_input":"2024-11-29T08:39:03.943153Z","iopub.status.idle":"2024-11-29T08:39:05.583897Z","shell.execute_reply.started":"2024-11-29T08:39:03.943107Z","shell.execute_reply":"2024-11-29T08:39:05.582725Z"}},"outputs":[],"execution_count":null},{"cell_type":"markdown","source":"## Upvotes greatly appreciated!\n\n#### Currently, this is all original work. I haven't referenced anyone else's work on this project yet.","metadata":{}},{"cell_type":"code","source":"from sklearn.model_selection import train_test_split\nimport catboost as ctb\nfrom sklearn.impute import SimpleImputer \nfrom sklearn.preprocessing import OneHotEncoder, StandardScaler\n\nfrom sklearn.ensemble import RandomForestRegressor, AdaBoostRegressor\nfrom sklearn.metrics import mean_squared_error\nimport time","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-11-29T08:39:05.585686Z","iopub.execute_input":"2024-11-29T08:39:05.586138Z","iopub.status.idle":"2024-11-29T08:39:08.598004Z","shell.execute_reply.started":"2024-11-29T08:39:05.586101Z","shell.execute_reply":"2024-11-29T08:39:08.596443Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"import matplotlib.pyplot as plt\nimport seaborn as sns","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-11-29T08:39:08.599813Z","iopub.execute_input":"2024-11-29T08:39:08.600466Z","iopub.status.idle":"2024-11-29T08:39:08.768729Z","shell.execute_reply.started":"2024-11-29T08:39:08.600420Z","shell.execute_reply":"2024-11-29T08:39:08.767281Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"import statistics\nimport math","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-11-29T08:39:08.772200Z","iopub.execute_input":"2024-11-29T08:39:08.773039Z","iopub.status.idle":"2024-11-29T08:39:08.782924Z","shell.execute_reply.started":"2024-11-29T08:39:08.772967Z","shell.execute_reply":"2024-11-29T08:39:08.781802Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"from warnings import simplefilter\nsimplefilter(action=\"ignore\", category=pd.errors.PerformanceWarning)","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-11-29T08:39:08.784383Z","iopub.execute_input":"2024-11-29T08:39:08.784806Z","iopub.status.idle":"2024-11-29T08:39:08.793015Z","shell.execute_reply.started":"2024-11-29T08:39:08.784766Z","shell.execute_reply":"2024-11-29T08:39:08.791801Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"f = open(\"/kaggle/input/brist1d/activities.txt\", \"r\")\nprint(f.read())","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-11-29T08:39:08.794275Z","iopub.execute_input":"2024-11-29T08:39:08.794645Z","iopub.status.idle":"2024-11-29T08:39:08.814205Z","shell.execute_reply.started":"2024-11-29T08:39:08.794568Z","shell.execute_reply":"2024-11-29T08:39:08.812846Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"activity_gauge = {\n    'Indoor climbing':3,\n    'Run':4,\n    'Strength training':3,\n    'Swim':2,\n    'Bike':2,\n    'Dancing':2,\n    'Stairclimber':3,#2\n    'Spinning':2,\n    'Walking':1,\n    'HIIT':4,\n    'Outdoor Bike':2,\n    'Walk':1,\n    'Aerobic Workout':2,\n    'Tennis':2,\n    'Workout':2,\n    'Hike':2,\n    'Zumba':2,\n    'Sport':3,\n    'Yoga':2,\n    'Swimming':2,\n    'Weights':3, #2\n    'Running':3\n}","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-11-29T08:39:08.815763Z","iopub.execute_input":"2024-11-29T08:39:08.816339Z","iopub.status.idle":"2024-11-29T08:39:08.823412Z","shell.execute_reply.started":"2024-11-29T08:39:08.816303Z","shell.execute_reply":"2024-11-29T08:39:08.822158Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"data = pd.read_csv('/kaggle/input/brist1d/train.csv')","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-11-29T08:39:08.824971Z","iopub.execute_input":"2024-11-29T08:39:08.825461Z","iopub.status.idle":"2024-11-29T08:39:23.062092Z","shell.execute_reply.started":"2024-11-29T08:39:08.825408Z","shell.execute_reply":"2024-11-29T08:39:23.060819Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"test = pd.read_csv('/kaggle/input/brist1d/test.csv')","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-11-29T08:39:23.063442Z","iopub.execute_input":"2024-11-29T08:39:23.063836Z","iopub.status.idle":"2024-11-29T08:39:23.314796Z","shell.execute_reply.started":"2024-11-29T08:39:23.063799Z","shell.execute_reply":"2024-11-29T08:39:23.313626Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"data.shape","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-11-29T08:39:23.319719Z","iopub.execute_input":"2024-11-29T08:39:23.320315Z","iopub.status.idle":"2024-11-29T08:39:23.328105Z","shell.execute_reply.started":"2024-11-29T08:39:23.320278Z","shell.execute_reply":"2024-11-29T08:39:23.326871Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"data.head()","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-11-29T08:39:23.329771Z","iopub.execute_input":"2024-11-29T08:39:23.330127Z","iopub.status.idle":"2024-11-29T08:39:23.378921Z","shell.execute_reply.started":"2024-11-29T08:39:23.330095Z","shell.execute_reply":"2024-11-29T08:39:23.377807Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"data['p_num'].unique()","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-11-29T08:39:23.380417Z","iopub.execute_input":"2024-11-29T08:39:23.380899Z","iopub.status.idle":"2024-11-29T08:39:23.401944Z","shell.execute_reply.started":"2024-11-29T08:39:23.380843Z","shell.execute_reply":"2024-11-29T08:39:23.400676Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"data.groupby('p_num')['id'].count()","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-11-29T08:39:23.403426Z","iopub.execute_input":"2024-11-29T08:39:23.403822Z","iopub.status.idle":"2024-11-29T08:39:23.435706Z","shell.execute_reply.started":"2024-11-29T08:39:23.403785Z","shell.execute_reply":"2024-11-29T08:39:23.434414Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"test.groupby('p_num')['id'].count()","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-11-29T08:39:23.437077Z","iopub.execute_input":"2024-11-29T08:39:23.437443Z","iopub.status.idle":"2024-11-29T08:39:23.448024Z","shell.execute_reply.started":"2024-11-29T08:39:23.437406Z","shell.execute_reply":"2024-11-29T08:39:23.446958Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"data.shape","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-11-29T08:39:23.449364Z","iopub.execute_input":"2024-11-29T08:39:23.449748Z","iopub.status.idle":"2024-11-29T08:39:23.459549Z","shell.execute_reply.started":"2024-11-29T08:39:23.449711Z","shell.execute_reply":"2024-11-29T08:39:23.458350Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"data.iloc[0].shape","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-11-29T08:39:23.460972Z","iopub.execute_input":"2024-11-29T08:39:23.461504Z","iopub.status.idle":"2024-11-29T08:39:23.474868Z","shell.execute_reply.started":"2024-11-29T08:39:23.461469Z","shell.execute_reply":"2024-11-29T08:39:23.473598Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"data.iloc[:,0].shape","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-11-29T08:39:23.476374Z","iopub.execute_input":"2024-11-29T08:39:23.476835Z","iopub.status.idle":"2024-11-29T08:39:23.491864Z","shell.execute_reply.started":"2024-11-29T08:39:23.476791Z","shell.execute_reply":"2024-11-29T08:39:23.490702Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"data.iloc[:50].columns","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-11-29T08:39:23.493340Z","iopub.execute_input":"2024-11-29T08:39:23.494363Z","iopub.status.idle":"2024-11-29T08:39:23.510940Z","shell.execute_reply.started":"2024-11-29T08:39:23.494308Z","shell.execute_reply":"2024-11-29T08:39:23.509804Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"data.dtypes.value_counts()","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-11-29T08:39:23.513058Z","iopub.execute_input":"2024-11-29T08:39:23.513562Z","iopub.status.idle":"2024-11-29T08:39:23.533248Z","shell.execute_reply.started":"2024-11-29T08:39:23.513497Z","shell.execute_reply":"2024-11-29T08:39:23.532128Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"data.select_dtypes('object').head(5)","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-11-29T08:39:23.534594Z","iopub.execute_input":"2024-11-29T08:39:23.534977Z","iopub.status.idle":"2024-11-29T08:39:23.681854Z","shell.execute_reply.started":"2024-11-29T08:39:23.534940Z","shell.execute_reply":"2024-11-29T08:39:23.680391Z"}},"outputs":[],"execution_count":null},{"cell_type":"markdown","source":"# Xy","metadata":{}},{"cell_type":"code","source":"X = data.iloc[:,:-1].copy()","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-11-29T08:39:23.683103Z","iopub.execute_input":"2024-11-29T08:39:23.683433Z","iopub.status.idle":"2024-11-29T08:39:24.425651Z","shell.execute_reply.started":"2024-11-29T08:39:23.683400Z","shell.execute_reply":"2024-11-29T08:39:24.424481Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"y = data.iloc[:,-1]","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-11-29T08:39:24.427189Z","iopub.execute_input":"2024-11-29T08:39:24.428190Z","iopub.status.idle":"2024-11-29T08:39:24.433671Z","shell.execute_reply.started":"2024-11-29T08:39:24.428136Z","shell.execute_reply":"2024-11-29T08:39:24.432426Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"X.shape","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-11-29T08:39:24.435048Z","iopub.execute_input":"2024-11-29T08:39:24.435376Z","iopub.status.idle":"2024-11-29T08:39:24.451482Z","shell.execute_reply.started":"2024-11-29T08:39:24.435346Z","shell.execute_reply":"2024-11-29T08:39:24.450358Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"test.shape","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-11-29T08:39:24.452734Z","iopub.execute_input":"2024-11-29T08:39:24.453061Z","iopub.status.idle":"2024-11-29T08:39:24.465696Z","shell.execute_reply.started":"2024-11-29T08:39:24.453030Z","shell.execute_reply":"2024-11-29T08:39:24.464661Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"pd.concat([X,test]).shape","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-11-29T08:39:24.466920Z","iopub.execute_input":"2024-11-29T08:39:24.467261Z","iopub.status.idle":"2024-11-29T08:39:24.912918Z","shell.execute_reply.started":"2024-11-29T08:39:24.467227Z","shell.execute_reply":"2024-11-29T08:39:24.911763Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"all_cols = X.columns.tolist()","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-11-29T08:39:24.914779Z","iopub.execute_input":"2024-11-29T08:39:24.915144Z","iopub.status.idle":"2024-11-29T08:39:24.919630Z","shell.execute_reply.started":"2024-11-29T08:39:24.915112Z","shell.execute_reply":"2024-11-29T08:39:24.918542Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"['bg','insulin','carbs','hr','steps','cals','activity']","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-11-29T08:39:24.921176Z","iopub.execute_input":"2024-11-29T08:39:24.921650Z","iopub.status.idle":"2024-11-29T08:39:24.933373Z","shell.execute_reply.started":"2024-11-29T08:39:24.921599Z","shell.execute_reply":"2024-11-29T08:39:24.932301Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"bg_cols = [i for i in X if i[:2] == 'bg']\ninsulin_cols = [i for i in X if i[:7] == 'insulin']\ncarbs_cols = [i for i in X if i[:5] == 'carbs']\nhr_cols = [i for i in X if i[:2] == 'hr']\nsteps_cols = [i for i in X if i[:5] == 'steps']\ncals_cols = [i for i in X if i[:4] == 'cals']\n\nactivity_cols = [i for i in X if i[:8] == 'activity']","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-11-29T08:39:24.939699Z","iopub.execute_input":"2024-11-29T08:39:24.940187Z","iopub.status.idle":"2024-11-29T08:39:24.948046Z","shell.execute_reply.started":"2024-11-29T08:39:24.940151Z","shell.execute_reply":"2024-11-29T08:39:24.946842Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"col_cats = [bg_cols,insulin_cols,carbs_cols,hr_cols,steps_cols,cals_cols]\n\nfor i in col_cats:\n    print(len(i))","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-11-29T08:39:24.949441Z","iopub.execute_input":"2024-11-29T08:39:24.949914Z","iopub.status.idle":"2024-11-29T08:39:24.961457Z","shell.execute_reply.started":"2024-11-29T08:39:24.949866Z","shell.execute_reply":"2024-11-29T08:39:24.960249Z"}},"outputs":[],"execution_count":null},{"cell_type":"markdown","source":"### Adding feature for recent changes (every fifteen minutes)\nThen adding the change of that change, which is effectively like a change in slope (derivatiive)","metadata":{}},{"cell_type":"markdown","source":"def add_recent_changes(X):\n    # Changes every 15 minutes\n    for key in col_dict:\n        print(key)\n        category = key\n        cols = col_dict[key]\n        new_cols = []\n        for i in range(-1,-22,-3):\n            new_col = category+'_'+str(i)+'back3'\n            print('Added Column: '+ new_col)\n            X[new_col] = X[cols[i]] - X[cols[i-3]]\n            new_cols.append(new_col)\n        for i in range(-1,-7,-1):\n            new_col = category+'_'+str(i)+'deriv'\n            print('Added Column: '+ new_col)\n            X[new_col] = X[new_cols[i]] - X[new_cols[i-1]]\n    return X","metadata":{}},{"cell_type":"markdown","source":"## Preprocessing and Transformations","metadata":{}},{"cell_type":"code","source":"global imputer\nimputer = SimpleImputer(missing_values=np.nan, strategy='mean')","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-11-29T08:39:24.962907Z","iopub.execute_input":"2024-11-29T08:39:24.963406Z","iopub.status.idle":"2024-11-29T08:39:24.979351Z","shell.execute_reply.started":"2024-11-29T08:39:24.963350Z","shell.execute_reply":"2024-11-29T08:39:24.978063Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"global scaler\nscaler = StandardScaler()","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-11-29T08:39:24.981124Z","iopub.execute_input":"2024-11-29T08:39:24.981646Z","iopub.status.idle":"2024-11-29T08:39:24.995735Z","shell.execute_reply.started":"2024-11-29T08:39:24.981561Z","shell.execute_reply":"2024-11-29T08:39:24.994649Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"def forward_fills(X):\n    for col_type in col_cats:\n        X[col_type] = X[col_type].ffill(axis = 1)\n        # then also back fill, which is better than imputing column means, I think\n        X[col_type] = X[col_type].bfill(axis = 1)\n    return X","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-11-29T08:39:24.997208Z","iopub.execute_input":"2024-11-29T08:39:24.997721Z","iopub.status.idle":"2024-11-29T08:39:25.009307Z","shell.execute_reply.started":"2024-11-29T08:39:24.997672Z","shell.execute_reply":"2024-11-29T08:39:25.007856Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"X[cals_cols].describe()","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-11-29T08:39:25.010815Z","iopub.execute_input":"2024-11-29T08:39:25.011200Z","iopub.status.idle":"2024-11-29T08:39:25.789417Z","shell.execute_reply.started":"2024-11-29T08:39:25.011165Z","shell.execute_reply":"2024-11-29T08:39:25.788063Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"X.groupby('p_num')[cals_cols].count()","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-11-29T08:39:25.790876Z","iopub.execute_input":"2024-11-29T08:39:25.791242Z","iopub.status.idle":"2024-11-29T08:39:25.859882Z","shell.execute_reply.started":"2024-11-29T08:39:25.791207Z","shell.execute_reply":"2024-11-29T08:39:25.858800Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"X.groupby('p_num')['id'].count()","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-11-29T08:39:25.861338Z","iopub.execute_input":"2024-11-29T08:39:25.861786Z","iopub.status.idle":"2024-11-29T08:39:25.889068Z","shell.execute_reply.started":"2024-11-29T08:39:25.861749Z","shell.execute_reply":"2024-11-29T08:39:25.887931Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"col_dict = {\n    'bg':bg_cols,\n    'insulin':insulin_cols,\n    'carbs':carbs_cols,\n    'hr':hr_cols,\n    'steps':steps_cols,\n    'cals':cals_cols\n}","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-11-29T08:39:25.890480Z","iopub.execute_input":"2024-11-29T08:39:25.890980Z","iopub.status.idle":"2024-11-29T08:39:25.896363Z","shell.execute_reply.started":"2024-11-29T08:39:25.890940Z","shell.execute_reply":"2024-11-29T08:39:25.895144Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"def create_participant_stats(X):\n    col_dict.keys()\n    df = []\n    for key in col_dict.keys():\n        start_time = time.time()\n        print(key)\n        cols = col_dict[key]\n        # values creates a large array of values, ravel puts them into a one dimension array\n        col_data = X[['p_num'] + cols].groupby('p_num')[cols].apply(lambda x: x.values).apply(lambda x: x.ravel())\n        # convert to list\n        col_data = col_data.apply(lambda x: x.tolist())\n        # remove nulls\n        col_data = col_data.apply(lambda x: [a for a in x if not math.isnan(a)])\n        # create mean and stdev for each patient\n        col_mean = col_data.apply(lambda x: statistics.mean(x))\n        col_mean.rename(key + '_mean', inplace = True)\n        col_mean = col_mean.to_frame()\n        df.append(col_mean)\n        col_stdev = col_data.apply(lambda x: statistics.stdev(x))\n        col_stdev.rename(key + '_stdev', inplace = True)\n        col_stdev = col_stdev.to_frame()\n        df.append(col_stdev)\n        print('{} {} sec'.format(key, round((time.time() - start_time),0)))\n    participant_stats = pd.concat(df, axis = 1)\n    return participant_stats","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-11-29T08:39:25.897662Z","iopub.execute_input":"2024-11-29T08:39:25.898016Z","iopub.status.idle":"2024-11-29T08:39:25.914982Z","shell.execute_reply.started":"2024-11-29T08:39:25.897971Z","shell.execute_reply":"2024-11-29T08:39:25.913741Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"def merge_participant_stats(X,participant_stats):\n    X = pd.merge(left = participant_stats, right = X, how = 'right', left_index = True, right_on = 'p_num')\n    return X","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-11-29T08:39:25.916780Z","iopub.execute_input":"2024-11-29T08:39:25.917319Z","iopub.status.idle":"2024-11-29T08:39:25.928727Z","shell.execute_reply.started":"2024-11-29T08:39:25.917266Z","shell.execute_reply":"2024-11-29T08:39:25.927671Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"def add_recent_changes(X):\n    # Changes every 15 minutes\n    for key in col_dict:\n        print(key)\n        category = key\n        cols = col_dict[key]\n        new_cols = []\n        for i in range(-1,-13,-3):\n            new_col = category+'_'+str(i)+'back3'\n            print('Added Column: '+ new_col)\n            X[new_col] = X[cols[i]] - X[cols[i-3]]\n            new_cols.append(new_col)\n        for i in range(-1,-4,-1):\n            new_col = category+'_'+str(i)+'deriv'\n            print('Added Column: '+ new_col)\n            X[new_col] = X[new_cols[i]] - X[new_cols[i-1]]\n    return X","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-11-29T08:39:25.929971Z","iopub.execute_input":"2024-11-29T08:39:25.930307Z","iopub.status.idle":"2024-11-29T08:39:25.949523Z","shell.execute_reply.started":"2024-11-29T08:39:25.930275Z","shell.execute_reply":"2024-11-29T08:39:25.948335Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"def drop_id_and_p_num_and_time(X):\n    X = X.drop(['id','p_num','time'], axis = 1)\n    return X\n\ndef drop_id_and_time(X):\n    X = X.drop(['id','time'], axis = 1)\n    return X","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-11-29T08:39:25.950943Z","iopub.execute_input":"2024-11-29T08:39:25.951323Z","iopub.status.idle":"2024-11-29T08:39:25.963169Z","shell.execute_reply.started":"2024-11-29T08:39:25.951281Z","shell.execute_reply":"2024-11-29T08:39:25.961974Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"def translate_activities(X):\n    X[activity_cols] = X[activity_cols].map(lambda x: activity_gauge[x] if x in activity_gauge else 0)\n    return X","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-11-29T08:39:25.964686Z","iopub.execute_input":"2024-11-29T08:39:25.965057Z","iopub.status.idle":"2024-11-29T08:39:25.980878Z","shell.execute_reply.started":"2024-11-29T08:39:25.965021Z","shell.execute_reply":"2024-11-29T08:39:25.979782Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"def standardized_carb_pairs(X, fit_transform = 1):\n    #\n    if fit_transform:\n        new_df = pd.DataFrame(scaler.fit_transform(X[insulin_cols + carbs_cols]),columns = insulin_cols + carbs_cols)\n    else:\n        new_df = pd.DataFrame(scaler.transform(X[insulin_cols + carbs_cols]),columns = insulin_cols + carbs_cols)\n    #\n    global carbs_insulin_cols\n    carbs_insulin_cols = []\n    for i in range(54,72):\n        new_col = 'carbs_insulin_'+str(i)\n        carbs_insulin_cols.append(new_col)\n        print('Added: ' + new_col)\n        X[new_col] = new_df[carbs_cols[i]] - new_df[insulin_cols[i]]\n    #\n    global carbs_insulin_cals_cols\n    carbs_insulin_cals_cols = []\n    for i in range(54,72):\n        new_col = 'carbs_insulin_cals_'+str(i)\n        carbs_insulin_cals_cols.append(new_col)\n        print('Added: ' + new_col)\n        X[new_col] = new_df[carbs_cols[i]] - new_df[insulin_cols[i]]\n    return X","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-11-29T08:39:25.982375Z","iopub.execute_input":"2024-11-29T08:39:25.982890Z","iopub.status.idle":"2024-11-29T08:39:25.995140Z","shell.execute_reply.started":"2024-11-29T08:39:25.982835Z","shell.execute_reply":"2024-11-29T08:39:25.994010Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"def drop_excess_cols(X):\n    for i in col_cats:\n        X = X.drop(i[:32], axis = 1)\n    return X","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-11-29T09:02:20.842636Z","iopub.execute_input":"2024-11-29T09:02:20.843299Z","iopub.status.idle":"2024-11-29T09:02:20.851269Z","shell.execute_reply.started":"2024-11-29T09:02:20.843249Z","shell.execute_reply":"2024-11-29T09:02:20.849504Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"def add_changes_standardized_carb_pairs(X):\n    for cols in [carbs_insulin_cols,carbs_insulin_cals_cols]:\n        print(cols)    \n        # print(key)\n        # category = key\n        # cols = col_dict[key]\n        new_cols = []\n        for i in range(-1,-13,-3):\n            new_col = cols[i]+'back3'\n            print('Added Column: '+ new_col)\n            X[new_col] = X[cols[i]] - X[cols[i-3]]\n            new_cols.append(new_col)\n        for i in range(-1,-4,-1):\n            new_col = new_cols[i]+'deriv'\n            print('Added Column: '+ new_col)\n            X[new_col] = X[new_cols[i]] - X[new_cols[i-1]]\n    return X","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-11-29T08:39:25.996534Z","iopub.execute_input":"2024-11-29T08:39:25.997068Z","iopub.status.idle":"2024-11-29T08:39:26.008254Z","shell.execute_reply.started":"2024-11-29T08:39:25.997016Z","shell.execute_reply":"2024-11-29T08:39:26.007065Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"def fill_nulls(X):\n    \"\"\"prerequisite, create and merge participant stats\"\"\"\n    for key in col_dict.keys():\n        cols = col_dict[key]\n        for col in cols:\n            X[col].fillna(X[key+'_mean'],inplace = True)\n    return X","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-11-29T08:39:26.009748Z","iopub.execute_input":"2024-11-29T08:39:26.010129Z","iopub.status.idle":"2024-11-29T08:39:26.025956Z","shell.execute_reply.started":"2024-11-29T08:39:26.010092Z","shell.execute_reply":"2024-11-29T08:39:26.024656Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"def create_standardized_cols(X):\n    global std_col_dict\n    std_col_dict = {}\n    \n    for key in col_dict:\n        cols = col_dict[key]\n        new_col_names = [key+'_std_'+str(i) for i in range(-1,-11,-1)]\n        new_col_names = [key+'_std_'+str(i) for i in range(-10,0)]\n        std_col_dict[key] = new_col_names\n        X[new_col_names] = X[[key + '_mean', key + '_stdev']+cols[-10:]].head().apply(lambda x: ( x - x[key + '_mean'] ) / x[key + '_stdev'], axis = 1)[cols[-10:]]\n        X[new_col_names] = X[new_col_names].fillna(0)\n    return X\n        ","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-11-29T08:39:26.027464Z","iopub.execute_input":"2024-11-29T08:39:26.027949Z","iopub.status.idle":"2024-11-29T08:39:26.043010Z","shell.execute_reply.started":"2024-11-29T08:39:26.027904Z","shell.execute_reply":"2024-11-29T08:39:26.041172Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"def create_combo_features(X):\n    for i in range(-10,0):\n        i = str(i)\n        X['combo'+i] = X['bg_std_'+i] - (0.5 * X['insulin_std_'+i]) - (0.5 * X['cals_std_'+i])\n    \n    combo_six_list = ['combo-6','combo-5','combo-4','combo-3','combo-2','combo-1']\n    \n    X['combo_all_6_sum'] = X[combo_six_list].sum(axis = 1)\n    X['combo_all_6_mean'] = X[combo_six_list].mean(axis = 1)\n    X[['combo-1_applied','combo_all_6_mean_applied']] = X[['combo-1','combo_all_6_mean','bg_mean']].apply(lambda x: (x + 1) * x['bg_mean'], axis = 1)[['combo-1','combo_all_6_mean']]\n    return X    ","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-11-29T08:54:31.790438Z","iopub.execute_input":"2024-11-29T08:54:31.790957Z","iopub.status.idle":"2024-11-29T08:54:31.800016Z","shell.execute_reply.started":"2024-11-29T08:54:31.790917Z","shell.execute_reply":"2024-11-29T08:54:31.798282Z"}},"outputs":[],"execution_count":null},{"cell_type":"markdown","source":"## List of transformation functions\n\nfill_nulls\n\ncreate_participant_stats(X)\n\nmerge_participant_stats(X,participant_stats):\n\nforward_fills(X)\n\nadd_recent_changes(X)\n\ndrop_id_and_p_num_and_time(X)\n\ndrop_id_and_time(X)\n\ntranslate_activities(X)\n\nstandardized_carb_pairs(X, fit_transform)\n\nadd_changes_standardized_carb_pairs(X)\n\ncreate_standardized_cols(X)","metadata":{}},{"cell_type":"code","source":"def all_transformations1(X, fit_transform = 1):\n    # participant_stats = create_participant_stats(X)\n    participant_stats = create_participant_stats(X)\n    X = merge_participant_stats(X,participant_stats)\n    X = forward_fills(X)\n    return X\n\ndef all_transformations2(X, fit_transform = 1):\n    X = fill_nulls(X) #uses columns created from participant stats\n    X = add_recent_changes(X)\n\n    # X = drop_id_and_p_num_and_time(X)\n    X = drop_id_and_time(X)\n    X = translate_activities(X)\n    return X\n\n    # imputer section\n    # if fit_transform:\n        # X = pd.DataFrame(imputer.fit_transform(X), columns = X.columns)\n    # else:\n        # X = pd.DataFrame(imputer.transform(X), columns = X.columns)\n\n    # X = standardized_carb_pairs(X, fit_transform)\n    # X = add_changes_standardized_carb_pairs(X)\n\ndef all_transformations3(X, fit_transform = 1):\n    X = create_standardized_cols(X)\n\n    return X\n    ","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-11-29T08:39:26.044684Z","iopub.execute_input":"2024-11-29T08:39:26.045235Z","iopub.status.idle":"2024-11-29T08:39:26.059396Z","shell.execute_reply.started":"2024-11-29T08:39:26.045176Z","shell.execute_reply":"2024-11-29T08:39:26.058153Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"def all_transformations(X):\n    # participant_stats = create_participant_stats(X)\n    participant_stats = create_participant_stats(X)\n    X = merge_participant_stats(X,participant_stats)\n    X = forward_fills(X)\n\n    X = fill_nulls(X) #uses columns created from participant stats\n    X = add_recent_changes(X)\n\n    X = translate_activities(X)\n\n\n    # imputer section\n    # if fit_transform:\n        # X = pd.DataFrame(imputer.fit_transform(X), columns = X.columns)\n    # else:\n        # X = pd.DataFrame(imputer.transform(X), columns = X.columns)\n\n    # X = standardized_carb_pairs(X, fit_transform)\n    # X = add_changes_standardized_carb_pairs(X)\n\n    X = create_standardized_cols(X)\n    X = create_combo_features(X)\n\n    X = drop_id_and_p_num_and_time(X)\n    # X = drop_excess_cols(X)\n    return X\n    ","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-11-29T08:56:11.598595Z","iopub.execute_input":"2024-11-29T08:56:11.599079Z","iopub.status.idle":"2024-11-29T08:56:11.605414Z","shell.execute_reply.started":"2024-11-29T08:56:11.599040Z","shell.execute_reply":"2024-11-29T08:56:11.604282Z"}},"outputs":[],"execution_count":null},{"cell_type":"markdown","source":"# Xy","metadata":{}},{"cell_type":"code","source":"X = data.iloc[:,:-1].copy()","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-11-29T08:39:26.081497Z","iopub.execute_input":"2024-11-29T08:39:26.081967Z","iopub.status.idle":"2024-11-29T08:39:26.893267Z","shell.execute_reply.started":"2024-11-29T08:39:26.081917Z","shell.execute_reply":"2024-11-29T08:39:26.891715Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"y = data.iloc[:,-1]","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-11-29T08:39:26.894756Z","iopub.execute_input":"2024-11-29T08:39:26.895150Z","iopub.status.idle":"2024-11-29T08:39:26.901076Z","shell.execute_reply.started":"2024-11-29T08:39:26.895111Z","shell.execute_reply":"2024-11-29T08:39:26.899659Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"data.shape","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-11-29T08:39:26.902451Z","iopub.execute_input":"2024-11-29T08:39:26.902975Z","iopub.status.idle":"2024-11-29T08:39:26.916203Z","shell.execute_reply.started":"2024-11-29T08:39:26.902924Z","shell.execute_reply":"2024-11-29T08:39:26.914975Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"X.shape","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-11-29T08:39:26.918238Z","iopub.execute_input":"2024-11-29T08:39:26.918635Z","iopub.status.idle":"2024-11-29T08:39:26.934810Z","shell.execute_reply.started":"2024-11-29T08:39:26.918594Z","shell.execute_reply":"2024-11-29T08:39:26.933704Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"X = all_transformations(X)\nX.shape","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-11-29T08:39:26.936268Z","iopub.execute_input":"2024-11-29T08:39:26.936742Z","iopub.status.idle":"2024-11-29T08:41:31.308985Z","shell.execute_reply.started":"2024-11-29T08:39:26.936703Z","shell.execute_reply":"2024-11-29T08:41:31.307850Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"X.isnull().sum().sum()","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-11-29T08:55:12.265365Z","iopub.execute_input":"2024-11-29T08:55:12.265913Z","iopub.status.idle":"2024-11-29T08:55:12.768240Z","shell.execute_reply.started":"2024-11-29T08:55:12.265866Z","shell.execute_reply":"2024-11-29T08:55:12.766712Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"X.head()","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-11-29T08:53:18.969568Z","iopub.execute_input":"2024-11-29T08:53:18.969985Z","iopub.status.idle":"2024-11-29T08:53:19.001314Z","shell.execute_reply.started":"2024-11-29T08:53:18.969950Z","shell.execute_reply":"2024-11-29T08:53:19.000009Z"}},"outputs":[],"execution_count":null},{"cell_type":"markdown","source":"## Work on the standardized columns","metadata":{}},{"cell_type":"markdown","source":"ps = create_participant_stats(X)\n\nX = merge_participant_stats(X,ps)\n\nps\n\nps_test = create_participant_stats(test)\n\nps\n\nps_test","metadata":{},"attachments":{}},{"cell_type":"markdown","source":"## Train Test Split","metadata":{}},{"cell_type":"code","source":"X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=25)","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-11-29T08:57:10.473882Z","iopub.execute_input":"2024-11-29T08:57:10.474406Z","iopub.status.idle":"2024-11-29T08:57:13.423799Z","shell.execute_reply.started":"2024-11-29T08:57:10.474364Z","shell.execute_reply":"2024-11-29T08:57:13.422665Z"}},"outputs":[],"execution_count":null},{"cell_type":"markdown","source":"## Catboost\n\n#### Models","metadata":{"execution":{"iopub.status.busy":"2024-11-27T17:01:54.856054Z","iopub.execute_input":"2024-11-27T17:01:54.856487Z","iopub.status.idle":"2024-11-27T17:01:54.861530Z","shell.execute_reply.started":"2024-11-27T17:01:54.856443Z","shell.execute_reply":"2024-11-27T17:01:54.860508Z"}},"attachments":{}},{"cell_type":"code","source":"random_forest = RandomForestRegressor(n_estimators = 5)\nadaboost = AdaBoostRegressor()\ncatboost = ctb.CatBoostRegressor(verbose = 100)","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-11-29T08:57:13.426411Z","iopub.execute_input":"2024-11-29T08:57:13.426993Z","iopub.status.idle":"2024-11-29T08:57:13.432992Z","shell.execute_reply.started":"2024-11-29T08:57:13.426938Z","shell.execute_reply":"2024-11-29T08:57:13.431704Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"model_used = catboost","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-11-29T08:57:13.434285Z","iopub.execute_input":"2024-11-29T08:57:13.434669Z","iopub.status.idle":"2024-11-29T08:57:13.449264Z","shell.execute_reply.started":"2024-11-29T08:57:13.434633Z","shell.execute_reply":"2024-11-29T08:57:13.448072Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"start_time = time.time()\nmodel_used.fit(X = X_train, y = y_train)\nprint('{} sec Catboost Train'.format(round((time.time() - start_time),0)))","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-11-29T08:57:13.451642Z","iopub.execute_input":"2024-11-29T08:57:13.452130Z","iopub.status.idle":"2024-11-29T08:59:59.299794Z","shell.execute_reply.started":"2024-11-29T08:57:13.452080Z","shell.execute_reply":"2024-11-29T08:59:59.298402Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"y_pred = model_used.predict(X_test)","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-11-29T09:02:48.791751Z","iopub.execute_input":"2024-11-29T09:02:48.792217Z","iopub.status.idle":"2024-11-29T09:02:48.972653Z","shell.execute_reply.started":"2024-11-29T09:02:48.792177Z","shell.execute_reply":"2024-11-29T09:02:48.971394Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"rmse = np.sqrt(mean_squared_error(y_test, y_pred))\n\nprint(\"RMSE:\", rmse)\n","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-11-29T09:03:23.122424Z","iopub.execute_input":"2024-11-29T09:03:23.122992Z","iopub.status.idle":"2024-11-29T09:03:23.133450Z","shell.execute_reply.started":"2024-11-29T09:03:23.122927Z","shell.execute_reply":"2024-11-29T09:03:23.131839Z"}},"outputs":[],"execution_count":null},{"cell_type":"markdown","source":"## ADABoost\n\n#### Skipping ADABoost, scores low and takes around 8 mins to run","metadata":{}},{"cell_type":"markdown","source":"start_time = time.time()\nadaboost.fit(X = X_train.to_numpy(), y = y_train)\nprint('{} sec Train'.format(round((time.time() - start_time),0)))","metadata":{"execution":{"iopub.status.busy":"2024-11-27T06:06:21.800312Z","iopub.execute_input":"2024-11-27T06:06:21.800739Z"}}},{"cell_type":"markdown","source":"y_pred = adaboost.predict(X_test)\n\nrmse = np.sqrt(mean_squared_error(y_test, y_pred))\n\nprint(\"RMSE:\", rmse)","metadata":{}},{"cell_type":"markdown","source":"## Light GBM","metadata":{}},{"cell_type":"code","source":"import lightgbm as lgb","metadata":{"trusted":true},"outputs":[],"execution_count":null},{"cell_type":"code","source":"light_gbm = lgb.LGBMRegressor()","metadata":{"trusted":true},"outputs":[],"execution_count":null},{"cell_type":"code","source":"start_time = time.time()\nlight_gbm.fit(X = X_train.to_numpy(), y = y_train)\nprint('{} sec LightGBM Train'.format(round((time.time() - start_time),0)))","metadata":{"trusted":true},"outputs":[],"execution_count":null},{"cell_type":"code","source":"y_pred = light_gbm.predict(X_test)\n\nrmse = np.sqrt(mean_squared_error(y_test, y_pred))\n\nprint(\"RMSE:\", rmse)","metadata":{"trusted":true},"outputs":[],"execution_count":null},{"cell_type":"markdown","source":"## XGBoost","metadata":{}},{"cell_type":"code","source":"import xgboost as xgb","metadata":{"trusted":true},"outputs":[],"execution_count":null},{"cell_type":"code","source":"# xgboost = xgb.XGBRegressor(eval_metric='rmsle')\nxgboost = xgb.XGBRegressor(eval_metric='rmse')","metadata":{"trusted":true},"outputs":[],"execution_count":null},{"cell_type":"code","source":"start_time = time.time()\nxgboost.fit(X = X_train.to_numpy(), y = y_train)\nprint('{} sec XGBoost Train'.format(round((time.time() - start_time),0)))","metadata":{"trusted":true},"outputs":[],"execution_count":null},{"cell_type":"code","source":"y_pred = xgboost.predict(X_test)\n\nrmse = np.sqrt(mean_squared_error(y_test, y_pred))\n\nprint(\"RMSE:\", rmse)","metadata":{"trusted":true},"outputs":[],"execution_count":null},{"cell_type":"markdown","source":"## Test","metadata":{}},{"cell_type":"code","source":"test = pd.read_csv('/kaggle/input/brist1d/test.csv')","metadata":{"trusted":true},"outputs":[],"execution_count":null},{"cell_type":"code","source":"test['p_num'].unique()","metadata":{"trusted":true},"outputs":[],"execution_count":null},{"cell_type":"code","source":"# test_final = all_transformations(test,0)\ntest_final = all_transformations(test)\ntest_final.shape","metadata":{"trusted":true},"outputs":[],"execution_count":null},{"cell_type":"code","source":"X.shape","metadata":{"trusted":true},"outputs":[],"execution_count":null},{"cell_type":"markdown","source":"## Final Training","metadata":{}},{"cell_type":"code","source":"start_time = time.time()\n# random_forest_final = RandomForestRegressor(n_estimators = 5)\n# adaboost_final = AdaBoostRegressor()\nmodel_used.fit(X = X, y = y)\nprint('{} sec Catboost Final Fit'.format(round((time.time() - start_time),0)))\n\n","metadata":{"trusted":true},"outputs":[],"execution_count":null},{"cell_type":"markdown","source":"## Submission","metadata":{}},{"cell_type":"code","source":"submission = pd.read_csv('/kaggle/input/brist1d/sample_submission.csv')","metadata":{"trusted":true},"outputs":[],"execution_count":null},{"cell_type":"code","source":"# test_pred = random_forest.predict(test_final)\n# test_pred = random_forest_final.predict(test_final)\ntest_pred = model_used.predict(test_final)","metadata":{"trusted":true},"outputs":[],"execution_count":null},{"cell_type":"code","source":"submission.head(5)","metadata":{"trusted":true},"outputs":[],"execution_count":null},{"cell_type":"code","source":"test_pred","metadata":{"trusted":true},"outputs":[],"execution_count":null},{"cell_type":"code","source":"submission['bg+1:00'] = test_pred","metadata":{"trusted":true},"outputs":[],"execution_count":null},{"cell_type":"code","source":"submission.head(5)","metadata":{"trusted":true},"outputs":[],"execution_count":null},{"cell_type":"code","source":"submission.to_csv('submission.csv', index=False)","metadata":{"trusted":true},"outputs":[],"execution_count":null}]}