{"metadata":{"kernelspec":{"language":"python","display_name":"Python 3","name":"python3"},"language_info":{"pygments_lexer":"ipython3","nbconvert_exporter":"python","version":"3.6.4","file_extension":".py","codemirror_mode":{"name":"ipython","version":3},"name":"python","mimetype":"text/x-python"}},"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\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","execution":{"iopub.status.busy":"2023-07-14T07:00:10.154622Z","iopub.execute_input":"2023-07-14T07:00:10.155700Z","iopub.status.idle":"2023-07-14T07:00:10.792726Z","shell.execute_reply.started":"2023-07-14T07:00:10.155622Z","shell.execute_reply":"2023-07-14T07:00:10.791497Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"##Credits to - https://www.kaggle.com/code/ammarnassanalhajali/freezing-of-gait-prediction/notebook","metadata":{"execution":{"iopub.status.busy":"2023-07-14T07:00:10.794925Z","iopub.execute_input":"2023-07-14T07:00:10.795740Z","iopub.status.idle":"2023-07-14T07:00:10.801233Z","shell.execute_reply.started":"2023-07-14T07:00:10.795680Z","shell.execute_reply":"2023-07-14T07:00:10.799512Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"import gc \nfrom glob import glob","metadata":{"execution":{"iopub.status.busy":"2023-07-14T07:00:10.804159Z","iopub.execute_input":"2023-07-14T07:00:10.805258Z","iopub.status.idle":"2023-07-14T07:00:10.817762Z","shell.execute_reply.started":"2023-07-14T07:00:10.805208Z","shell.execute_reply":"2023-07-14T07:00:10.816375Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"\npath=\"/kaggle/input/tlvmc-parkinsons-freezing-gait-prediction/\"\n\ntrain_defog = glob(path+'train/defog/**')\ntrain_tdcsfog = glob(path+'train/tdcsfog/**')","metadata":{"execution":{"iopub.status.busy":"2023-07-14T07:00:10.820932Z","iopub.execute_input":"2023-07-14T07:00:10.821808Z","iopub.status.idle":"2023-07-14T07:00:10.840020Z","shell.execute_reply.started":"2023-07-14T07:00:10.821752Z","shell.execute_reply":"2023-07-14T07:00:10.838878Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"\n\n\ntrain_defog[0 :10]","metadata":{"execution":{"iopub.status.busy":"2023-07-14T07:00:10.841882Z","iopub.execute_input":"2023-07-14T07:00:10.843252Z","iopub.status.idle":"2023-07-14T07:00:10.858053Z","shell.execute_reply.started":"2023-07-14T07:00:10.843186Z","shell.execute_reply":"2023-07-14T07:00:10.856508Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"\ndef get_data(f):\n    df = pd.read_csv(f)\n    df['Id'] = f.split('/')[-1].split('.')[0]\n    df['data_type'] = f.split('/')[-2]\n    return df\n#-----------------------------------\ndf_train_defog = pd.concat([get_data(f) for f in train_defog])\ndf_train_tdcsfog = pd.concat([get_data(f) for f in train_tdcsfog])\n#-----------------------------------\ndf_train=pd.concat([df_train_defog,df_train_tdcsfog])\n#-----------------------------------\nprint(df_train_defog.shape)\nprint(df_train_tdcsfog.shape)\n\nprint(df_train.shape)\n#-----------------------------------\ndf_train.fillna(0,inplace=True)\nprint(df_train.isnull().sum().sum())","metadata":{"execution":{"iopub.status.busy":"2023-07-14T07:00:10.859877Z","iopub.execute_input":"2023-07-14T07:00:10.860473Z","iopub.status.idle":"2023-07-14T07:01:42.638308Z","shell.execute_reply.started":"2023-07-14T07:00:10.860413Z","shell.execute_reply":"2023-07-14T07:01:42.636913Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df_train","metadata":{"execution":{"iopub.status.busy":"2023-07-14T07:01:42.640006Z","iopub.execute_input":"2023-07-14T07:01:42.640416Z","iopub.status.idle":"2023-07-14T07:01:42.682650Z","shell.execute_reply.started":"2023-07-14T07:01:42.640374Z","shell.execute_reply":"2023-07-14T07:01:42.681085Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df_train = df_train.dropna()","metadata":{"execution":{"iopub.status.busy":"2023-07-14T07:01:42.684464Z","iopub.execute_input":"2023-07-14T07:01:42.684919Z","iopub.status.idle":"2023-07-14T07:01:58.100322Z","shell.execute_reply.started":"2023-07-14T07:01:42.684874Z","shell.execute_reply":"2023-07-14T07:01:58.099040Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df_train.drop(columns = ['Task' , 'Valid' , 'data_type' ] , inplace = True)","metadata":{"execution":{"iopub.status.busy":"2023-07-14T07:01:58.102187Z","iopub.execute_input":"2023-07-14T07:01:58.102651Z","iopub.status.idle":"2023-07-14T07:01:59.208947Z","shell.execute_reply.started":"2023-07-14T07:01:58.102602Z","shell.execute_reply":"2023-07-14T07:01:59.207365Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df_train.info()","metadata":{"execution":{"iopub.status.busy":"2023-07-14T07:01:59.214528Z","iopub.execute_input":"2023-07-14T07:01:59.215031Z","iopub.status.idle":"2023-07-14T07:01:59.238527Z","shell.execute_reply.started":"2023-07-14T07:01:59.214982Z","shell.execute_reply":"2023-07-14T07:01:59.237008Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"gc.collect()","metadata":{"execution":{"iopub.status.busy":"2023-07-14T07:01:59.240722Z","iopub.execute_input":"2023-07-14T07:01:59.241314Z","iopub.status.idle":"2023-07-14T07:01:59.365514Z","shell.execute_reply.started":"2023-07-14T07:01:59.241203Z","shell.execute_reply":"2023-07-14T07:01:59.364265Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# # df_defog_metadata = pd.read_csv(\"/kaggle/input/tlvmc-parkinsons-freezing-gait-prediction/defog_metadata.csv\")\n# # df_defog_metadata.head()\n# df_defog_metadata = None","metadata":{"execution":{"iopub.status.busy":"2023-07-14T07:01:59.367277Z","iopub.execute_input":"2023-07-14T07:01:59.368770Z","iopub.status.idle":"2023-07-14T07:01:59.379306Z","shell.execute_reply.started":"2023-07-14T07:01:59.368713Z","shell.execute_reply":"2023-07-14T07:01:59.378143Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# events = pd.read_csv(\"/kaggle/input/tlvmc-parkinsons-freezing-gait-prediction/events.csv\")\n# events.head()","metadata":{"execution":{"iopub.status.busy":"2023-07-14T07:01:59.382370Z","iopub.execute_input":"2023-07-14T07:01:59.383445Z","iopub.status.idle":"2023-07-14T07:01:59.399051Z","shell.execute_reply.started":"2023-07-14T07:01:59.383387Z","shell.execute_reply":"2023-07-14T07:01:59.396406Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# events.drop(columns=['Type' , 'Kinetic' ,] , inplace = True)","metadata":{"execution":{"iopub.status.busy":"2023-07-14T07:01:59.401226Z","iopub.execute_input":"2023-07-14T07:01:59.402469Z","iopub.status.idle":"2023-07-14T07:01:59.415898Z","shell.execute_reply.started":"2023-07-14T07:01:59.402404Z","shell.execute_reply":"2023-07-14T07:01:59.414095Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# from sklearn.preprocessing import LabelEncoder\n\n# le = LabelEncoder()\n# df_train.fit_transform(events['Type'])","metadata":{"execution":{"iopub.status.busy":"2023-07-14T07:01:59.417865Z","iopub.execute_input":"2023-07-14T07:01:59.418291Z","iopub.status.idle":"2023-07-14T07:01:59.436696Z","shell.execute_reply.started":"2023-07-14T07:01:59.418241Z","shell.execute_reply":"2023-07-14T07:01:59.434925Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# df = df_train.merge(events , how ='inner' , on ='Id')","metadata":{"execution":{"iopub.status.busy":"2023-07-14T07:01:59.439221Z","iopub.execute_input":"2023-07-14T07:01:59.439835Z","iopub.status.idle":"2023-07-14T07:01:59.452230Z","shell.execute_reply.started":"2023-07-14T07:01:59.439779Z","shell.execute_reply":"2023-07-14T07:01:59.450093Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# # tasks = pd.read_csv(\"/kaggle/input/tlvmc-parkinsons-freezing-gait-prediction/tasks.csv\")\n# # tasks.head()\n# tasks = None","metadata":{"execution":{"iopub.status.busy":"2023-07-14T07:01:59.454476Z","iopub.execute_input":"2023-07-14T07:01:59.455736Z","iopub.status.idle":"2023-07-14T07:01:59.470182Z","shell.execute_reply.started":"2023-07-14T07:01:59.455682Z","shell.execute_reply":"2023-07-14T07:01:59.468654Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# # tdcsfog_metadata = pd.read_csv(\"/kaggle/input/tlvmc-parkinsons-freezing-gait-prediction/tdcsfog_metadata.csv\")\n# # tdcsfog_metadata.head()\n# tdcsfog_metadata = None","metadata":{"execution":{"iopub.status.busy":"2023-07-14T07:01:59.471959Z","iopub.execute_input":"2023-07-14T07:01:59.472498Z","iopub.status.idle":"2023-07-14T07:01:59.486658Z","shell.execute_reply.started":"2023-07-14T07:01:59.472437Z","shell.execute_reply":"2023-07-14T07:01:59.484857Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df_train.head()","metadata":{"execution":{"iopub.status.busy":"2023-07-14T07:01:59.489754Z","iopub.execute_input":"2023-07-14T07:01:59.490179Z","iopub.status.idle":"2023-07-14T07:01:59.516923Z","shell.execute_reply.started":"2023-07-14T07:01:59.490135Z","shell.execute_reply":"2023-07-14T07:01:59.515270Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df_train.info()","metadata":{"execution":{"iopub.status.busy":"2023-07-14T07:01:59.518889Z","iopub.execute_input":"2023-07-14T07:01:59.519310Z","iopub.status.idle":"2023-07-14T07:01:59.541028Z","shell.execute_reply.started":"2023-07-14T07:01:59.519268Z","shell.execute_reply":"2023-07-14T07:01:59.539606Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# df_train['Valid'] = np.where(df_train.Valid == False , 0 , 1)\n# df_train['Task'] =  np.where(df_train.Task == False , 0 , 1)\n# df_train['data_type'] = np.where(df_train.data_type == 'defog' , 0 , 1)","metadata":{"execution":{"iopub.status.busy":"2023-07-14T07:01:59.542937Z","iopub.execute_input":"2023-07-14T07:01:59.543381Z","iopub.status.idle":"2023-07-14T07:01:59.553052Z","shell.execute_reply.started":"2023-07-14T07:01:59.543335Z","shell.execute_reply":"2023-07-14T07:01:59.551592Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df_train.head(10)","metadata":{"execution":{"iopub.status.busy":"2023-07-14T07:01:59.555145Z","iopub.execute_input":"2023-07-14T07:01:59.555710Z","iopub.status.idle":"2023-07-14T07:01:59.586121Z","shell.execute_reply.started":"2023-07-14T07:01:59.555647Z","shell.execute_reply":"2023-07-14T07:01:59.584654Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"dependent , target = df_train.columns.difference(['StartHesitation' ,'Turn' , 'Walking' , 'Id' , 'Time']) , ['StartHesitation' ,'Turn' , 'Walking']","metadata":{"execution":{"iopub.status.busy":"2023-07-14T07:01:59.588346Z","iopub.execute_input":"2023-07-14T07:01:59.589057Z","iopub.status.idle":"2023-07-14T07:01:59.597228Z","shell.execute_reply.started":"2023-07-14T07:01:59.588993Z","shell.execute_reply":"2023-07-14T07:01:59.595944Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"print(gc.get_count())\ngc.collect()\nprint(gc.get_count())","metadata":{"execution":{"iopub.status.busy":"2023-07-14T07:01:59.598515Z","iopub.execute_input":"2023-07-14T07:01:59.598947Z","iopub.status.idle":"2023-07-14T07:01:59.749680Z","shell.execute_reply.started":"2023-07-14T07:01:59.598904Z","shell.execute_reply":"2023-07-14T07:01:59.747948Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"from sklearn.model_selection import train_test_split\n\ntrainx , testx , trainy , testy = train_test_split(df_train[dependent] , df_train[target] , test_size =  0.25 )","metadata":{"execution":{"iopub.status.busy":"2023-07-14T07:01:59.751449Z","iopub.execute_input":"2023-07-14T07:01:59.752008Z","iopub.status.idle":"2023-07-14T07:02:04.655836Z","shell.execute_reply.started":"2023-07-14T07:01:59.751960Z","shell.execute_reply":"2023-07-14T07:02:04.654124Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"print(trainx.shape)\nprint(trainy.shape)\nprint(testx.shape)\nprint(testy.shape)","metadata":{"execution":{"iopub.status.busy":"2023-07-14T07:02:04.657782Z","iopub.execute_input":"2023-07-14T07:02:04.658581Z","iopub.status.idle":"2023-07-14T07:02:04.667414Z","shell.execute_reply.started":"2023-07-14T07:02:04.658507Z","shell.execute_reply":"2023-07-14T07:02:04.665678Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"trainx.head()","metadata":{"execution":{"iopub.status.busy":"2023-07-14T07:02:04.670137Z","iopub.execute_input":"2023-07-14T07:02:04.671017Z","iopub.status.idle":"2023-07-14T07:02:04.692302Z","shell.execute_reply.started":"2023-07-14T07:02:04.670955Z","shell.execute_reply":"2023-07-14T07:02:04.690657Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"print(gc.get_count())\ngc.collect()\nprint(gc.get_count())","metadata":{"execution":{"iopub.status.busy":"2023-07-14T07:02:04.700462Z","iopub.execute_input":"2023-07-14T07:02:04.700958Z","iopub.status.idle":"2023-07-14T07:02:04.837435Z","shell.execute_reply.started":"2023-07-14T07:02:04.700893Z","shell.execute_reply":"2023-07-14T07:02:04.835976Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# from sklearn.model_selection import GridSearchCV\n# import lightgbm as lgb\n# from sklearn.multioutput import MultiOutputClassifier\n\n# lgbm = lgb.LGBMClassifier()\n\n# multi_lgbm_model = MultiOutputClassifier(lgbm)\n\n\n# # create parameter grid for GridSearchCV\n# param_grid = {\n#  'estimator__learning_rate': [0.1],\n#     'estimator__max_depth': [8 ,10   ],\n#     'estimator__n_estimators': [ 650 , 700] , \n# #     'estimator__num_leaves' : [ None  ,10, 15  ] , \n# #     'estimator__min_data_in_leaf': [None ],\n# }\n\n\n\n# grid = GridSearchCV(multi_lgbm_model , param_grid=param_grid, cv=3)\n\n# # fit the model on the data\n# grid.fit(trainx , trainy)\n\n# # print best parameters and scores\n# print('Best parameters:', grid.best_params_)\n# print('Best R2 score:', grid.best_score_)\n\n\n","metadata":{"execution":{"iopub.status.busy":"2023-07-14T07:02:04.839633Z","iopub.execute_input":"2023-07-14T07:02:04.840045Z","iopub.status.idle":"2023-07-14T09:45:13.238660Z","shell.execute_reply.started":"2023-07-14T07:02:04.840004Z","shell.execute_reply":"2023-07-14T09:45:13.236868Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"print(gc.get_count())\ngc.collect()\nprint(gc.get_count())","metadata":{"execution":{"iopub.status.busy":"2023-07-14T10:26:51.956939Z","iopub.execute_input":"2023-07-14T10:26:51.958231Z","iopub.status.idle":"2023-07-14T10:26:52.244452Z","shell.execute_reply.started":"2023-07-14T10:26:51.958177Z","shell.execute_reply":"2023-07-14T10:26:52.243117Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"\n# Best parameters: {'estimator__learning_rate': 0.1, 'estimator__max_depth': 8, 'estimator__n_estimators': 650}\n# Best R2 score: 0.8720810062348168","metadata":{"execution":{"iopub.status.busy":"2023-07-14T09:45:13.450108Z","iopub.execute_input":"2023-07-14T09:45:13.450630Z","iopub.status.idle":"2023-07-14T09:45:13.624998Z","shell.execute_reply.started":"2023-07-14T09:45:13.450587Z","shell.execute_reply":"2023-07-14T09:45:13.622787Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# # print(\"Best hyperparameters:\", grid_search.best_params_)\n# # print(\"Best accuracy score:\", grid_search.best_score_)\n   \n# Best hyperparameters: {'estimator__learning_rate': 0.1, 'estimator__max_depth': 10, 'estimator__n_estimators': 600}\n# Best accuracy score: 0.8734467394406509\n\n    \n#     Best hyperparameters: {'estimator__learning_rate': 0.1, 'estimator__max_depth': 4, 'estimator__n_estimators': 600}\n# Best accuracy score: 0.8722663228590336\n# add Codeadd Markdown","metadata":{"execution":{"iopub.status.busy":"2023-07-14T09:45:13.626452Z","iopub.status.idle":"2023-07-14T09:45:13.627965Z","shell.execute_reply.started":"2023-07-14T09:45:13.627483Z","shell.execute_reply":"2023-07-14T09:45:13.627564Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"import lightgbm as lgb\nfrom sklearn.multioutput import MultiOutputClassifier\n\nclf = lgb.LGBMClassifier(learning_rate = 0.1 , max_depth = 8 , n_estimators = 650)\nmulti_clf = MultiOutputClassifier(clf)\nmulti_clf.fit(trainx , trainy)","metadata":{"execution":{"iopub.status.busy":"2023-07-14T10:09:27.697972Z","iopub.execute_input":"2023-07-14T10:09:27.700251Z","iopub.status.idle":"2023-07-14T10:23:00.993887Z","shell.execute_reply.started":"2023-07-14T10:09:27.700173Z","shell.execute_reply":"2023-07-14T10:23:00.992447Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"from sklearn import metrics\nprint(metrics.average_precision_score(testy, multi_clf.predict(testx).clip(0.0,1.0)))","metadata":{"execution":{"iopub.status.busy":"2023-07-14T10:23:29.494045Z","iopub.execute_input":"2023-07-14T10:23:29.495506Z","iopub.status.idle":"2023-07-14T10:26:25.140541Z","shell.execute_reply.started":"2023-07-14T10:23:29.495445Z","shell.execute_reply":"2023-07-14T10:26:25.139068Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# import glob\n# sub = pd.read_csv('/kaggle/input/tlvmc-parkinsons-freezing-gait-prediction/sample_submission.csv')\n# test = glob.glob('/kaggle/input/tlvmc-parkinsons-freezing-gait-prediction/test/**/**')\n\n# # sub['t'] = 0\n# submission = []\n# for f in test :\n#     df = pd.read_csv(f)\n#     df['Id'] = f.split('/')[-1].split('.')[0]\n#     df = df.fillna(0).reset_index(drop = True)\n#     result = pd.DataFrame(multi_clf.predict(df[dependent] ) , columns=['StartHesitation', 'Turn' , 'Walking'])\n#     df = pd.concat([df,result], axis=1)\n#     df['Id'] = df['Id'].astype(str) + '_' + df['Time'].astype(str)","metadata":{"execution":{"iopub.status.busy":"2023-07-14T09:45:13.636144Z","iopub.status.idle":"2023-07-14T09:45:13.636642Z","shell.execute_reply.started":"2023-07-14T09:45:13.636385Z","shell.execute_reply":"2023-07-14T09:45:13.636412Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# df","metadata":{"execution":{"iopub.status.busy":"2023-07-14T09:45:13.638224Z","iopub.status.idle":"2023-07-14T09:45:13.638738Z","shell.execute_reply.started":"2023-07-14T09:45:13.638463Z","shell.execute_reply":"2023-07-14T09:45:13.638490Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"import glob\nsub = pd.read_csv(path+'sample_submission.csv')\ntest = glob.glob(path+'test/**/**')\n\nsub['t'] = 0\nsubmission = []\nfor f in test:\n    df = pd.read_csv(f)\n    df['Id'] = f.split('/')[-1].split('.')[0]\n    df = df.fillna(0).reset_index(drop=True)\n    result = pd.DataFrame(multi_clf.predict(df[dependent] ) , columns=['StartHesitation', 'Turn' , 'Walking'])\n    df = pd.concat([df,result], axis=1)\n    df['Id'] = df['Id'].astype(str) + '_' + df['Time'].astype(str)\n    submission.append(df[['Id','StartHesitation', 'Turn' , 'Walking']])\nsubmission = pd.concat(submission)\nsubmission = pd.merge(sub[['Id','t']], submission, how='left', on='Id').fillna(0.0)\nsubmission[['Id','StartHesitation', 'Turn' , 'Walking']].to_csv('submission.csv', index=False)","metadata":{"execution":{"iopub.status.busy":"2023-07-14T10:27:08.636275Z","iopub.execute_input":"2023-07-14T10:27:08.636783Z","iopub.status.idle":"2023-07-14T10:27:20.049285Z","shell.execute_reply.started":"2023-07-14T10:27:08.636736Z","shell.execute_reply":"2023-07-14T10:27:20.047632Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"submission.head()","metadata":{"execution":{"iopub.status.busy":"2023-07-14T10:29:36.496150Z","iopub.execute_input":"2023-07-14T10:29:36.496671Z","iopub.status.idle":"2023-07-14T10:29:36.512563Z","shell.execute_reply.started":"2023-07-14T10:29:36.496624Z","shell.execute_reply":"2023-07-14T10:29:36.511042Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"submission.to_csv('/kaggle/working/submission.csv' , index = False)","metadata":{"execution":{"iopub.status.busy":"2023-07-14T10:35:18.737732Z","iopub.execute_input":"2023-07-14T10:35:18.738301Z","iopub.status.idle":"2023-07-14T10:35:19.585426Z","shell.execute_reply.started":"2023-07-14T10:35:18.738245Z","shell.execute_reply":"2023-07-14T10:35:19.584087Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]}]}