{"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":"markdown","source":"<p style=\"font-size: 24px; font-weight: bold;\">Hello there!</p>\n\n<p style=\"font-size: 16px;\">This notebook introduces a super simple way to create a submission file for the competition of <b>\"Parkinson's Freezing of Gait Prediction\"</b>.</p>\n\n<p style=\"font-size: 16px;\">In this notebook, you will create features by combining 3-dimensional accelerometer data values with metadata about subjects in order to detect FoG (Freezing of Gait) events.</p>\n\n<p style=\"font-size: 16px;\">To predict FoG events (<code>'StartHesitation'</code>, <code>'Turn'</code>, <code>'Walking'</code>) at a given time point <code><b>t</b></code>, you will use the accelerometer data values and subject information at the same time point <code><b>t</b></code>.</p>\n\n<p style=\"font-size: 16px;\">However, since this procedure does not handle temporal information well, it must be necessary to conduct innovative feature engineering to achieve better performance.</p>\n\n<p style=\"font-size: 16px;\">The purpose of publishing this notebook is to demonstrate the rough procedure up to submitting results for the competition using simple code as much as possible.</p>\n\n<p style=\"font-size: 16px;\">I hope that the release of this notebook will contribute even a little to the excitement of the competition.</p>\n\n<p style=\"font-size: 16px;\">Let's enjoy Kaggle together!</p>\n\n<h1>Import Modules</h1>","metadata":{}},{"cell_type":"code","source":"import os\nimport tqdm\nimport glob\nimport numpy as np\nimport pandas as pd\nfrom sklearn.ensemble import RandomForestClassifier","metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","execution":{"iopub.status.busy":"2023-04-20T03:15:05.766077Z","iopub.execute_input":"2023-04-20T03:15:05.766473Z","iopub.status.idle":"2023-04-20T03:15:07.514213Z","shell.execute_reply.started":"2023-04-20T03:15:05.766437Z","shell.execute_reply":"2023-04-20T03:15:07.512381Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# parent directory\npdir = '/kaggle/input/tlvmc-parkinsons-freezing-gait-prediction'","metadata":{"execution":{"iopub.status.busy":"2023-04-20T03:15:07.517604Z","iopub.execute_input":"2023-04-20T03:15:07.518217Z","iopub.status.idle":"2023-04-20T03:15:07.525605Z","shell.execute_reply.started":"2023-04-20T03:15:07.518154Z","shell.execute_reply":"2023-04-20T03:15:07.523962Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# load meta data","metadata":{}},{"cell_type":"code","source":"df_tdcs_meta = pd.read_csv(os.path.join(pdir, 'tdcsfog_metadata.csv'))\ndf_tdcs_meta.head()","metadata":{"execution":{"iopub.status.busy":"2023-04-20T03:15:07.529844Z","iopub.execute_input":"2023-04-20T03:15:07.530428Z","iopub.status.idle":"2023-04-20T03:15:07.602251Z","shell.execute_reply.started":"2023-04-20T03:15:07.530366Z","shell.execute_reply":"2023-04-20T03:15:07.601233Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df_defog_meta = pd.read_csv(os.path.join(pdir, 'defog_metadata.csv'))\ndf_defog_meta.head()","metadata":{"execution":{"iopub.status.busy":"2023-04-20T03:15:07.604277Z","iopub.execute_input":"2023-04-20T03:15:07.604822Z","iopub.status.idle":"2023-04-20T03:15:07.624322Z","shell.execute_reply.started":"2023-04-20T03:15:07.604788Z","shell.execute_reply":"2023-04-20T03:15:07.623084Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df_subjects = pd.read_csv(os.path.join(pdir, 'subjects.csv'))\ndf_subjects.head()","metadata":{"execution":{"iopub.status.busy":"2023-04-20T03:15:07.625769Z","iopub.execute_input":"2023-04-20T03:15:07.626794Z","iopub.status.idle":"2023-04-20T03:15:07.651947Z","shell.execute_reply.started":"2023-04-20T03:15:07.626758Z","shell.execute_reply":"2023-04-20T03:15:07.650754Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# Load tdcsfog data","metadata":{}},{"cell_type":"code","source":"# list of all tdcsfog csv file path\ntdcs_file_path = glob.glob(os.path.join(pdir, 'train', 'tdcsfog', '*.csv'), recursive=True)\n\n# In this notebook, we limit the number of files to be read in order to reduce the time required for model training.\ntdcs_file_path = tdcs_file_path[::100]\n\nprint(f'the number of files to be read: {len(tdcs_file_path)}')","metadata":{"execution":{"iopub.status.busy":"2023-04-20T03:15:16.114026Z","iopub.execute_input":"2023-04-20T03:15:16.114548Z","iopub.status.idle":"2023-04-20T03:15:16.126800Z","shell.execute_reply.started":"2023-04-20T03:15:16.114506Z","shell.execute_reply":"2023-04-20T03:15:16.125187Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# Initialize a DataFrame to combine data from multiple CSV files.\ndf_tdcs = pd.DataFrame()\n\n# load tdcsfog time series in combination with metadata.\nfor fp in tqdm.tqdm(tdcs_file_path):    \n    \n    # load data into a variable 'tmp'.\n    tmp = pd.read_csv(fp)\n    \n    # get file Id from csv file name.\n    file_id = os.path.basename(fp).replace(\".csv\", \"\")\n    \n    # get subject Id.\n    subject = df_tdcs_meta.loc[df_tdcs_meta['Id'] == file_id, 'Subject'].iloc[0]\n    \n    # add metadata.\n    tmp['Medication'] = df_tdcs_meta.loc[df_tdcs_meta['Id'] == file_id, 'Medication'].iloc[0]\n    tmp['Age'] = df_subjects.loc[df_subjects['Subject'] == subject, 'Age'].iloc[0]\n    tmp['Sex'] = df_subjects.loc[df_subjects['Subject'] == subject, 'Sex'].iloc[0]\n    tmp['YearsSinceDx'] = df_subjects.loc[df_subjects['Subject'] == subject, 'YearsSinceDx'].iloc[0]\n    tmp['NFOGQ'] =df_subjects.loc[df_subjects['Subject'] == subject, 'NFOGQ'].iloc[0]\n    \n    # concat the data\n    df_tdcs = pd.concat([df_tdcs, tmp]).reset_index(drop=True)","metadata":{"execution":{"iopub.status.busy":"2023-04-20T03:15:17.231566Z","iopub.execute_input":"2023-04-20T03:15:17.232095Z","iopub.status.idle":"2023-04-20T03:15:17.586593Z","shell.execute_reply.started":"2023-04-20T03:15:17.232049Z","shell.execute_reply":"2023-04-20T03:15:17.585013Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# check the contents of the df_tdcs\ndf_tdcs.head()","metadata":{"execution":{"iopub.status.busy":"2023-04-20T03:15:18.354260Z","iopub.execute_input":"2023-04-20T03:15:18.354834Z","iopub.status.idle":"2023-04-20T03:15:18.375299Z","shell.execute_reply.started":"2023-04-20T03:15:18.354784Z","shell.execute_reply":"2023-04-20T03:15:18.373697Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# Load defog data","metadata":{}},{"cell_type":"code","source":"# list of all tdcsfog csv file path\ndefog_file_path = glob.glob(os.path.join(pdir, 'train', 'defog', '*.csv'), recursive=True)\n\n# In this notebook, we limit the number of files to be read in order to reduce the time required for model training.\ndefog_file_path = defog_file_path[::50]\n\nprint(f'the number of files to be read: {len(defog_file_path)}')","metadata":{"execution":{"iopub.status.busy":"2023-04-20T03:15:19.704624Z","iopub.execute_input":"2023-04-20T03:15:19.705071Z","iopub.status.idle":"2023-04-20T03:15:19.722578Z","shell.execute_reply.started":"2023-04-20T03:15:19.705032Z","shell.execute_reply":"2023-04-20T03:15:19.721175Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# Initialize a DataFrame to combine data from multiple CSV files.\ndf_defog = pd.DataFrame()\n\nfor fp in tqdm.tqdm(defog_file_path):\n    # load data into a variable 'tmp'.\n    tmp = pd.read_csv(fp)\n    \n    # get file Id from csv file name.\n    file_id = os.path.basename(fp).replace(\".csv\", \"\")\n    \n    # get subject Id.\n    subject = df_defog_meta.loc[df_defog_meta['Id'] == file_id, 'Subject'].iloc[0]\n    \n    # add metadata.\n    tmp['Medication'] = df_defog_meta.loc[df_defog_meta['Id'] == file_id, 'Medication'].iloc[0]\n    tmp['Age'] = df_subjects.loc[df_subjects['Subject'] == subject, 'Age'].iloc[0]\n    tmp['Sex'] = df_subjects.loc[df_subjects['Subject'] == subject, 'Sex'].iloc[0]\n    tmp['YearsSinceDx'] = df_subjects.loc[df_subjects['Subject'] == subject, 'YearsSinceDx'].iloc[0]\n    tmp['NFOGQ'] =df_subjects.loc[df_subjects['Subject'] == subject, 'NFOGQ'].iloc[0]\n    \n    # extract data from the time period where Valid and Task are both True.\n    tmp = tmp[(tmp['Valid'] == True) & (tmp['Task']==True)]\n    tmp = tmp.drop(['Valid', 'Task'], axis=1)\n    \n    # concat the data\n    df_defog = pd.concat([df_defog, tmp]).reset_index(drop=True)","metadata":{"execution":{"iopub.status.busy":"2023-04-20T03:15:20.717643Z","iopub.execute_input":"2023-04-20T03:15:20.718075Z","iopub.status.idle":"2023-04-20T03:15:21.279638Z","shell.execute_reply.started":"2023-04-20T03:15:20.718037Z","shell.execute_reply":"2023-04-20T03:15:21.278230Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# check the contents of the df_defog\ndf_defog.head()","metadata":{"execution":{"iopub.status.busy":"2023-04-20T03:15:21.702330Z","iopub.execute_input":"2023-04-20T03:15:21.703287Z","iopub.status.idle":"2023-04-20T03:15:21.723138Z","shell.execute_reply.started":"2023-04-20T03:15:21.703234Z","shell.execute_reply":"2023-04-20T03:15:21.721284Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# Prepare train data","metadata":{}},{"cell_type":"code","source":"# concat tdcs and defog data.\ndf_train = pd.concat([df_tdcs, df_defog]).reset_index(drop=True)\ndf_train.head()","metadata":{"execution":{"iopub.status.busy":"2023-04-20T03:15:23.830178Z","iopub.execute_input":"2023-04-20T03:15:23.830699Z","iopub.status.idle":"2023-04-20T03:15:23.891263Z","shell.execute_reply.started":"2023-04-20T03:15:23.830654Z","shell.execute_reply":"2023-04-20T03:15:23.889891Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# encode string columns into 0/1 format\ndf_train['Medication'] = np.where(df_train['Medication']=='on', 1, 0)\ndf_train['Sex'] = np.where(df_train['Sex']=='M', 1, 0)\ndf_train.head()","metadata":{"execution":{"iopub.status.busy":"2023-04-20T03:15:26.781334Z","iopub.execute_input":"2023-04-20T03:15:26.781875Z","iopub.status.idle":"2023-04-20T03:15:26.822640Z","shell.execute_reply.started":"2023-04-20T03:15:26.781826Z","shell.execute_reply":"2023-04-20T03:15:26.821123Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# split data into features and target.\ny = df_train[['StartHesitation', 'Turn', 'Walking']]                       # target\nX = df_train.drop(['StartHesitation', 'Turn', 'Walking', 'Time'], axis=1)  # feature","metadata":{"execution":{"iopub.status.busy":"2023-04-20T03:15:27.802597Z","iopub.execute_input":"2023-04-20T03:15:27.803091Z","iopub.status.idle":"2023-04-20T03:15:27.820691Z","shell.execute_reply.started":"2023-04-20T03:15:27.803052Z","shell.execute_reply":"2023-04-20T03:15:27.819572Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# check the contents of the target\ny.head()","metadata":{"execution":{"iopub.status.busy":"2023-04-20T03:15:32.673371Z","iopub.execute_input":"2023-04-20T03:15:32.674038Z","iopub.status.idle":"2023-04-20T03:15:32.685784Z","shell.execute_reply.started":"2023-04-20T03:15:32.673997Z","shell.execute_reply":"2023-04-20T03:15:32.684493Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# check the contents of the feature\nX.head()","metadata":{"execution":{"iopub.status.busy":"2023-04-20T03:15:33.517312Z","iopub.execute_input":"2023-04-20T03:15:33.518129Z","iopub.status.idle":"2023-04-20T03:15:33.534507Z","shell.execute_reply.started":"2023-04-20T03:15:33.518086Z","shell.execute_reply":"2023-04-20T03:15:33.533026Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# Train RandomForestClassifier","metadata":{}},{"cell_type":"code","source":"# train the model with default parameter\nrf = RandomForestClassifier(random_state=0)\nrf.fit(X, y)","metadata":{"execution":{"iopub.status.busy":"2023-04-20T03:15:35.072636Z","iopub.execute_input":"2023-04-20T03:15:35.073142Z","iopub.status.idle":"2023-04-20T03:16:01.294639Z","shell.execute_reply.started":"2023-04-20T03:15:35.073103Z","shell.execute_reply":"2023-04-20T03:16:01.293147Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# Prepare test data\n\n## Process the test data in the same way as the training data","metadata":{}},{"cell_type":"code","source":"# list of all tdcsfog csv file path\ntdcs_test_file_path = glob.glob(os.path.join(pdir, 'test', 'tdcsfog', '*.csv'), recursive=True)\nprint(f'the number of files to be read: {len(tdcs_test_file_path)}')","metadata":{"execution":{"iopub.status.busy":"2023-04-20T03:16:01.298124Z","iopub.execute_input":"2023-04-20T03:16:01.299059Z","iopub.status.idle":"2023-04-20T03:16:01.312395Z","shell.execute_reply.started":"2023-04-20T03:16:01.299010Z","shell.execute_reply":"2023-04-20T03:16:01.310793Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# Initialize a DataFrame to combine data from multiple CSV files.\ndf_tdcs_test = pd.DataFrame()\n\nfor fp in tqdm.tqdm(tdcs_test_file_path):\n    \n    # load data into a variable 'tmp'.\n    tmp = pd.read_csv(fp)\n    \n    # get file Id from csv file name.\n    file_id = os.path.basename(fp).replace(\".csv\", \"\")\n    \n    # get subject Id.\n    subject = df_tdcs_meta.loc[df_tdcs_meta['Id'] == file_id, 'Subject'].iloc[0]\n    \n    # add metadata.\n    tmp['Medication'] = df_tdcs_meta.loc[df_tdcs_meta['Id'] == file_id, 'Medication'].iloc[0]\n    tmp['Age'] = df_subjects.loc[df_subjects['Subject'] == subject, 'Age'].iloc[0]\n    tmp['Sex'] = df_subjects.loc[df_subjects['Subject'] == subject, 'Sex'].iloc[0]\n    tmp['YearsSinceDx'] = df_subjects.loc[df_subjects['Subject'] == subject, 'YearsSinceDx'].iloc[0]\n    tmp['NFOGQ'] =df_subjects.loc[df_subjects['Subject'] == subject, 'NFOGQ'].iloc[0]\n    \n    # add Id data to submit.\n    tmp['Id'] = file_id + '_' + tmp['Time'].astype(str)\n    \n    # concat the data\n    df_tdcs_test = pd.concat([df_tdcs_test, tmp]).reset_index(drop=True)","metadata":{"execution":{"iopub.status.busy":"2023-04-20T03:16:01.314298Z","iopub.execute_input":"2023-04-20T03:16:01.314717Z","iopub.status.idle":"2023-04-20T03:16:01.362969Z","shell.execute_reply.started":"2023-04-20T03:16:01.314651Z","shell.execute_reply":"2023-04-20T03:16:01.361465Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# check the contents of the df_tdcs_test\ndf_tdcs_test.head()","metadata":{"execution":{"iopub.status.busy":"2023-04-20T03:16:01.365575Z","iopub.execute_input":"2023-04-20T03:16:01.366078Z","iopub.status.idle":"2023-04-20T03:16:01.386036Z","shell.execute_reply.started":"2023-04-20T03:16:01.366034Z","shell.execute_reply":"2023-04-20T03:16:01.384786Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# list of all tdcsfog csv file path\ndefog_test_file_path = glob.glob(os.path.join(pdir, 'test', 'defog', '*.csv'), recursive=True)\nprint(f'the number of files to be read: {len(defog_test_file_path)}')","metadata":{"execution":{"iopub.status.busy":"2023-04-20T03:16:01.388496Z","iopub.execute_input":"2023-04-20T03:16:01.388915Z","iopub.status.idle":"2023-04-20T03:16:01.399630Z","shell.execute_reply.started":"2023-04-20T03:16:01.388819Z","shell.execute_reply":"2023-04-20T03:16:01.397924Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# Initialize a DataFrame to combine data from multiple CSV files.\ndf_defog_test = pd.DataFrame()\n\nfor fp in tqdm.tqdm(defog_test_file_path):\n    # load data into a variable 'tmp'.\n    tmp = pd.read_csv(fp)\n    \n    # get file Id from csv file name.\n    file_id = os.path.basename(fp).replace(\".csv\", \"\")\n    \n    # get subject Id.\n    subject = df_defog_meta.loc[df_defog_meta['Id'] == file_id, 'Subject'].iloc[0]\n    \n    # add metadata.\n    tmp['Medication'] = df_defog_meta.loc[df_defog_meta['Id'] == file_id, 'Medication'].iloc[0]\n    tmp['Age'] = df_subjects.loc[df_subjects['Subject'] == subject, 'Age'].iloc[0]\n    tmp['Sex'] = df_subjects.loc[df_subjects['Subject'] == subject, 'Sex'].iloc[0]\n    tmp['YearsSinceDx'] = df_subjects.loc[df_subjects['Subject'] == subject, 'YearsSinceDx'].iloc[0]\n    tmp['NFOGQ'] =df_subjects.loc[df_subjects['Subject'] == subject, 'NFOGQ'].iloc[0]\n    \n    # add Id data to submit.\n    tmp['Id'] = file_id + '_' + tmp['Time'].astype(str)\n    \n    # concat the data\n    df_defog_test = pd.concat([df_defog_test, tmp]).reset_index(drop=True)","metadata":{"execution":{"iopub.status.busy":"2023-04-20T03:16:01.401336Z","iopub.execute_input":"2023-04-20T03:16:01.401671Z","iopub.status.idle":"2023-04-20T03:16:02.400989Z","shell.execute_reply.started":"2023-04-20T03:16:01.401639Z","shell.execute_reply":"2023-04-20T03:16:02.399275Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# check the contents of the df_defog_test\ndf_defog_test.head()","metadata":{"execution":{"iopub.status.busy":"2023-04-20T03:16:02.403227Z","iopub.execute_input":"2023-04-20T03:16:02.403606Z","iopub.status.idle":"2023-04-20T03:16:02.422224Z","shell.execute_reply.started":"2023-04-20T03:16:02.403572Z","shell.execute_reply":"2023-04-20T03:16:02.420543Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# concat tdcs and defog data.\ndf_test = pd.concat([df_tdcs_test, df_defog_test]).reset_index(drop=True)\n\n# encode string columns into 0/1 format\ndf_test['Medication'] = np.where(df_test['Medication']=='on', 1, 0)\ndf_test['Sex'] = np.where(df_test['Sex']=='M', 1, 0)\ndisplay(df_test)","metadata":{"execution":{"iopub.status.busy":"2023-04-20T03:16:02.424481Z","iopub.execute_input":"2023-04-20T03:16:02.426380Z","iopub.status.idle":"2023-04-20T03:16:02.609835Z","shell.execute_reply.started":"2023-04-20T03:16:02.426318Z","shell.execute_reply":"2023-04-20T03:16:02.608195Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# split data into submission Id and feature.\nId = df_test['Id']                             # Id for submission data\nX_test = df_test.drop(['Time', 'Id'], axis=1)  # feature of test data\nX_test.head()","metadata":{"execution":{"iopub.status.busy":"2023-04-20T03:16:02.611913Z","iopub.execute_input":"2023-04-20T03:16:02.612326Z","iopub.status.idle":"2023-04-20T03:16:02.645268Z","shell.execute_reply.started":"2023-04-20T03:16:02.612289Z","shell.execute_reply":"2023-04-20T03:16:02.643825Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# Predict and submit","metadata":{}},{"cell_type":"code","source":"# calculate prediction using trained RandomForestClassifier model.\nprediction = rf.predict(X_test)","metadata":{"execution":{"iopub.status.busy":"2023-04-20T03:16:02.648782Z","iopub.execute_input":"2023-04-20T03:16:02.649244Z","iopub.status.idle":"2023-04-20T03:16:08.207550Z","shell.execute_reply.started":"2023-04-20T03:16:02.649203Z","shell.execute_reply":"2023-04-20T03:16:08.206009Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# Prepare submit data\nsubmit = pd.DataFrame(Id, columns=['Id'])\nsubmit['StartHesitation'] = prediction[:, 0]\nsubmit['Turn'] = prediction[:, 1]\nsubmit['Walking'] = prediction[:, 2]","metadata":{"execution":{"iopub.status.busy":"2023-04-20T03:16:08.209864Z","iopub.execute_input":"2023-04-20T03:16:08.210478Z","iopub.status.idle":"2023-04-20T03:16:08.225650Z","shell.execute_reply.started":"2023-04-20T03:16:08.210424Z","shell.execute_reply":"2023-04-20T03:16:08.224285Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"display(submit)","metadata":{"execution":{"iopub.status.busy":"2023-04-20T03:16:13.733126Z","iopub.execute_input":"2023-04-20T03:16:13.733591Z","iopub.status.idle":"2023-04-20T03:16:13.749350Z","shell.execute_reply.started":"2023-04-20T03:16:13.733553Z","shell.execute_reply":"2023-04-20T03:16:13.748198Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# Save the created submission data.\nsubmit.to_csv('submission.csv', index=False)","metadata":{"execution":{"iopub.status.busy":"2023-04-20T03:16:14.741205Z","iopub.execute_input":"2023-04-20T03:16:14.742737Z","iopub.status.idle":"2023-04-20T03:16:15.174122Z","shell.execute_reply.started":"2023-04-20T03:16:14.742678Z","shell.execute_reply":"2023-04-20T03:16:15.172557Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"<p style=\"font-size: 24px; font-weight: bold;\">Congratulations!</p>\n\n<p style=\"font-size: 16px;\">You're now ready to submit your work on Kaggle!</p>\n\n<p style=\"font-size: 16px;\">Enjoy your experience on Kaggle!</p>","metadata":{}}]}