{"metadata":{"kaggle":{"accelerator":"none","dataSources":[{"sourceId":59093,"databundleVersionId":7469972,"sourceType":"competition"}],"dockerImageVersionId":30646,"isInternetEnabled":false,"language":"python","sourceType":"notebook","isGpuEnabled":false},"kernelspec":{"display_name":"Python 3","language":"python","name":"python3"},"language_info":{"codemirror_mode":{"name":"ipython","version":3},"file_extension":".py","mimetype":"text/x-python","name":"python","nbconvert_exporter":"python","pygments_lexer":"ipython3","version":"3.10.13"},"papermill":{"default_parameters":{},"duration":4.618377,"end_time":"2024-02-17T10:30:58.589729","environment_variables":{},"exception":null,"input_path":"__notebook__.ipynb","output_path":"__notebook__.ipynb","parameters":{},"start_time":"2024-02-17T10:30:53.971352","version":"2.5.0"}},"nbformat_minor":4,"nbformat":4,"cells":[{"cell_type":"code","source":"import pandas as pd\nimport numpy as np","metadata":{"_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","papermill":{"duration":0.982298,"end_time":"2024-02-17T10:30:57.908351","exception":false,"start_time":"2024-02-17T10:30:56.926053","status":"completed"},"tags":[],"execution":{"iopub.status.busy":"2024-02-19T12:34:04.008192Z","iopub.execute_input":"2024-02-19T12:34:04.008574Z","iopub.status.idle":"2024-02-19T12:34:05.441324Z","shell.execute_reply.started":"2024-02-19T12:34:04.008545Z","shell.execute_reply":"2024-02-19T12:34:05.439875Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df = pd.read_csv('/kaggle/input/hms-harmful-brain-activity-classification/train.csv')\nTARGETS = df.columns[-6:]","metadata":{"papermill":{"duration":0.031371,"end_time":"2024-02-17T10:30:57.943955","exception":false,"start_time":"2024-02-17T10:30:57.912584","status":"completed"},"tags":[],"execution":{"iopub.status.busy":"2024-02-19T12:37:44.562788Z","iopub.execute_input":"2024-02-19T12:37:44.563206Z","iopub.status.idle":"2024-02-19T12:37:44.841265Z","shell.execute_reply.started":"2024-02-19T12:37:44.563171Z","shell.execute_reply":"2024-02-19T12:37:44.840068Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"pred = (df[TARGETS].sum() / df[TARGETS].sum().sum()).to_numpy()","metadata":{"execution":{"iopub.status.busy":"2024-02-19T12:52:44.037343Z","iopub.execute_input":"2024-02-19T12:52:44.037764Z","iopub.status.idle":"2024-02-19T12:52:44.049230Z","shell.execute_reply.started":"2024-02-19T12:52:44.037730Z","shell.execute_reply":"2024-02-19T12:52:44.047995Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"test = pd.read_csv('/kaggle/input/hms-harmful-brain-activity-classification/test.csv')\nprint('Test shape',test.shape)\ntest.head()","metadata":{"papermill":{"duration":0.026158,"end_time":"2024-02-17T10:30:57.973040","exception":false,"start_time":"2024-02-17T10:30:57.946882","status":"completed"},"tags":[],"execution":{"iopub.status.busy":"2024-02-19T12:52:46.709627Z","iopub.execute_input":"2024-02-19T12:52:46.710003Z","iopub.status.idle":"2024-02-19T12:52:46.724014Z","shell.execute_reply.started":"2024-02-19T12:52:46.709975Z","shell.execute_reply":"2024-02-19T12:52:46.722863Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"sub = pd.DataFrame({'eeg_id': test.eeg_id.values})","metadata":{"papermill":{"duration":0.014853,"end_time":"2024-02-17T10:30:57.992132","exception":false,"start_time":"2024-02-17T10:30:57.977279","status":"completed"},"tags":[],"execution":{"iopub.status.busy":"2024-02-19T12:52:47.112583Z","iopub.execute_input":"2024-02-19T12:52:47.112972Z","iopub.status.idle":"2024-02-19T12:52:47.119628Z","shell.execute_reply.started":"2024-02-19T12:52:47.112942Z","shell.execute_reply":"2024-02-19T12:52:47.118106Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"sub[TARGETS] = pred\nsub.to_csv('submission.csv',index=False)\nprint('Submissionn shape',sub.shape)\nsub.head()","metadata":{"papermill":{"duration":0.030649,"end_time":"2024-02-17T10:30:58.027114","exception":false,"start_time":"2024-02-17T10:30:57.996465","status":"completed"},"tags":[],"execution":{"iopub.status.busy":"2024-02-19T12:52:47.725370Z","iopub.execute_input":"2024-02-19T12:52:47.725737Z","iopub.status.idle":"2024-02-19T12:52:47.743967Z","shell.execute_reply.started":"2024-02-19T12:52:47.725708Z","shell.execute_reply":"2024-02-19T12:52:47.742775Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# SANITY CHECK TO CONFIRM PREDICTIONS SUM TO ONE\nsub.iloc[:,-6:].sum(axis=1)","metadata":{"papermill":{"duration":0.023795,"end_time":"2024-02-17T10:30:58.055600","exception":false,"start_time":"2024-02-17T10:30:58.031805","status":"completed"},"tags":[],"execution":{"iopub.status.busy":"2024-02-19T12:52:48.870259Z","iopub.execute_input":"2024-02-19T12:52:48.870701Z","iopub.status.idle":"2024-02-19T12:52:48.880089Z","shell.execute_reply.started":"2024-02-19T12:52:48.870665Z","shell.execute_reply":"2024-02-19T12:52:48.878916Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{"papermill":{"duration":0.004392,"end_time":"2024-02-17T10:30:58.064774","exception":false,"start_time":"2024-02-17T10:30:58.060382","status":"completed"},"tags":[]},"execution_count":null,"outputs":[]}]}