{"metadata":{"kernelspec":{"language":"python","display_name":"Python 3","name":"python3"},"language_info":{"name":"python","version":"3.10.13","mimetype":"text/x-python","codemirror_mode":{"name":"ipython","version":3},"pygments_lexer":"ipython3","nbconvert_exporter":"python","file_extension":".py"},"kaggle":{"accelerator":"none","dataSources":[{"sourceId":59093,"databundleVersionId":7469972,"sourceType":"competition"}],"dockerImageVersionId":30664,"isInternetEnabled":false,"language":"python","sourceType":"notebook","isGpuEnabled":false}},"nbformat_minor":4,"nbformat":4,"cells":[{"cell_type":"code","source":"import pandas as pd\nimport numpy as np\n\nfrom scipy.special import softmax","metadata":{"_uuid":"82f7dfda-1021-407e-b094-20c8f5ac80e6","_cell_guid":"c01dec05-1199-4518-b7a3-5837ac72116b","collapsed":false,"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2024-02-29T16:00:18.121196Z","iopub.execute_input":"2024-02-29T16:00:18.121848Z","iopub.status.idle":"2024-02-29T16:00:18.126382Z","shell.execute_reply.started":"2024-02-29T16:00:18.121817Z","shell.execute_reply":"2024-02-29T16:00:18.125305Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"test_df = pd.read_csv(\"/kaggle/input/hms-harmful-brain-activity-classification/test.csv\")","metadata":{"execution":{"iopub.status.busy":"2024-02-29T16:00:18.128966Z","iopub.execute_input":"2024-02-29T16:00:18.129393Z","iopub.status.idle":"2024-02-29T16:00:18.143716Z","shell.execute_reply.started":"2024-02-29T16:00:18.129364Z","shell.execute_reply":"2024-02-29T16:00:18.142329Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"all_logits = np.zeros((len(test_df), 6))\nall_preds = softmax(all_logits, axis=1)\nall_preds","metadata":{"execution":{"iopub.status.busy":"2024-02-29T16:00:18.145685Z","iopub.execute_input":"2024-02-29T16:00:18.146030Z","iopub.status.idle":"2024-02-29T16:00:18.154651Z","shell.execute_reply.started":"2024-02-29T16:00:18.146002Z","shell.execute_reply":"2024-02-29T16:00:18.153480Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"classes = ['seizure', 'lpd', 'gpd', 'lrda', 'grda', 'other']\ntarget_cols = [f'{c}_vote' for c in classes]\n\nsubmission_df = pd.DataFrame({'eeg_id': test_df['eeg_id']})\nsubmission_df[target_cols] = all_preds\nsubmission_df.to_csv('submission.csv', index=False)\nsubmission_df","metadata":{"execution":{"iopub.status.busy":"2024-02-29T16:01:16.632951Z","iopub.execute_input":"2024-02-29T16:01:16.633382Z","iopub.status.idle":"2024-02-29T16:01:16.660668Z","shell.execute_reply.started":"2024-02-29T16:01:16.633353Z","shell.execute_reply":"2024-02-29T16:01:16.659197Z"},"trusted":true},"execution_count":null,"outputs":[]}]}