{"metadata":{"kernelspec":{"language":"python","display_name":"Python 3","name":"python3"},"language_info":{"name":"python","version":"3.10.12","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":30635,"isInternetEnabled":false,"language":"python","sourceType":"notebook","isGpuEnabled":false}},"nbformat_minor":4,"nbformat":4,"cells":[{"cell_type":"code","source":"import pandas as pd\nimport matplotlib.pyplot as plt\nimport seaborn as sns\n\nsns.set(style=\"whitegrid\")\ntrain = pd.read_csv(\"/kaggle/input/hms-harmful-brain-activity-classification/train.csv\")\n\ntrain.head()","metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","execution":{"iopub.status.busy":"2024-01-24T03:29:30.117614Z","iopub.execute_input":"2024-01-24T03:29:30.117958Z","iopub.status.idle":"2024-01-24T03:29:31.831385Z","shell.execute_reply.started":"2024-01-24T03:29:30.117928Z","shell.execute_reply":"2024-01-24T03:29:31.830612Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"**train.csv** Metadata for the train set. The expert annotators reviewed 50 second long EEG samples plus matched spectrograms covering 10 a minute window centered at the same time and labeled the central 10 seconds. Many of these samples overlapped and have been consolidated. train.csv provides the metadata that allows you to extract the original subsets that the raters annotated.\n\n**eeg_id** - A unique identifier for the entire EEG recording.\n\n**eeg_sub_id** - An ID for the specific 50 second long subsample this row's labels apply to.\n\n**eeg_label_offset_seconds** - The time between the beginning of the consolidated EEG and this subsample.\n\n**spectrogram_id** - A unique identifier for the entire EEG recording.\n\n**spectrogram_sub_id** - An ID for the specific 10 minute subsample this row's labels apply to.\n\n**spectogram_label_offset_seconds** - The time between the beginning of the consolidated spectrogram and this subsample.\n\n**label_id** - An ID for this set of labels.\n\n**patient_id** - An ID for the patient who donated the data.\n\n**expert_consensus** - The consensus annotator label. Provided for convenience only.\n\n**[seizure/lpd/gpd/lrda/grda/other]_vote** - The count of annotator votes for a given brain activity class. The full names of the activity classes are as follows: lpd: lateralized periodic discharges, gpd: generalized periodic discharges, lrd: lateralized rhythmic delta activity, and grda: generalized rhythmic delta activity . A detailed explanations of these patterns is available here.\n","metadata":{}},{"cell_type":"markdown","source":"## Brain activity notebook series\n\n### [EEGS 10–20 system](https://www.kaggle.com/code/seshurajup/eegs-10-20-system)\nBetter understanding eegs 10-20 system\n### [Missing Eeg_ids Train.csv vs train_eegs [Resolved]](https://www.kaggle.com/code/seshurajup/missing-eeg-ids-in-train-csv-vs-train-eegs-parquet)\nExtra training eggs [Resolved] as we can ignore it\n### [EDA train.csv](https://www.kaggle.com/code/seshurajup/eda-train-csv)\nDetailed analysis of the train.csv\n### [Eegs Pairing Analysis & Features](https://www.kaggle.com/code/seshurajup/eegs-pairing-analysis-features)\nPairing features analysis and build features\n### [Eegs Target Analysis - Correct way to merge target](https://www.kaggle.com/code/seshurajup/eegs-target-analysis-correct-way-to-merge-target)\nHow to choice the target votes for training\n### [Eegs Train Split (CV)](https://www.kaggle.com/seshurajup/eegs-train-splits-cv)\ngenerate better train split without patient_id overlap\n### [Spectrogram Distribution Analysis (Sample)](https://www.kaggle.com/code/seshurajup/spectrogram-distribution-analysis-sample?scriptVersionId=160198896)\nExplore the reason - magic of **np.clip(img,np.exp(-4),np.exp(8))** which improved all public LB scores by 0.1 - introduced by Chris\n#### **Upvote my work if it is useful**","metadata":{}},{"cell_type":"code","source":"rows, columns = train.shape\nrows, columns","metadata":{"execution":{"iopub.status.busy":"2024-01-24T03:29:31.833183Z","iopub.execute_input":"2024-01-24T03:29:31.833594Z","iopub.status.idle":"2024-01-24T03:29:31.837952Z","shell.execute_reply.started":"2024-01-24T03:29:31.833568Z","shell.execute_reply":"2024-01-24T03:29:31.837364Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train_info = train.info()\ntrain_info","metadata":{"execution":{"iopub.status.busy":"2024-01-24T03:29:31.838747Z","iopub.execute_input":"2024-01-24T03:29:31.840246Z","iopub.status.idle":"2024-01-24T03:29:31.954647Z","shell.execute_reply.started":"2024-01-24T03:29:31.840198Z","shell.execute_reply":"2024-01-24T03:29:31.953782Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train.describe()","metadata":{"execution":{"iopub.status.busy":"2024-01-24T03:29:31.956882Z","iopub.execute_input":"2024-01-24T03:29:31.957158Z","iopub.status.idle":"2024-01-24T03:29:32.026817Z","shell.execute_reply.started":"2024-01-24T03:29:31.957134Z","shell.execute_reply":"2024-01-24T03:29:32.025331Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"categorical_columns = train.select_dtypes(include=['object', 'category']).columns\ncategorical_summary = train[categorical_columns].describe()\ncategorical_summary","metadata":{"execution":{"iopub.status.busy":"2024-01-24T03:29:32.028209Z","iopub.execute_input":"2024-01-24T03:29:32.028558Z","iopub.status.idle":"2024-01-24T03:29:32.054324Z","shell.execute_reply.started":"2024-01-24T03:29:32.028530Z","shell.execute_reply":"2024-01-24T03:29:32.053468Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"list(set(train['expert_consensus'].unique()))","metadata":{"execution":{"iopub.status.busy":"2024-01-24T03:29:32.055629Z","iopub.execute_input":"2024-01-24T03:29:32.056172Z","iopub.status.idle":"2024-01-24T03:29:32.068309Z","shell.execute_reply.started":"2024-01-24T03:29:32.056139Z","shell.execute_reply":"2024-01-24T03:29:32.066942Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"plt.figure(figsize=(10, 6))\nsns.countplot(data=train, x='expert_consensus')\nplt.title('Distribution of Expert Consensus')\nplt.xlabel('Expert Consensus')\nplt.ylabel('Count')\nplt.xticks(rotation=45)\nplt.show()","metadata":{"execution":{"iopub.status.busy":"2024-01-24T03:29:32.071212Z","iopub.execute_input":"2024-01-24T03:29:32.071563Z","iopub.status.idle":"2024-01-24T03:29:32.472353Z","shell.execute_reply.started":"2024-01-24T03:29:32.071536Z","shell.execute_reply":"2024-01-24T03:29:32.471239Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"plt.figure(figsize=(10, 6))\nsns.histplot(train['patient_id'], bins=30, kde=False)\nplt.title('Distribution of Patient ID')\nplt.xlabel('Patient ID')\nplt.ylabel('Count')\nplt.show()","metadata":{"execution":{"iopub.status.busy":"2024-01-24T03:29:32.474304Z","iopub.execute_input":"2024-01-24T03:29:32.474693Z","iopub.status.idle":"2024-01-24T03:29:32.867270Z","shell.execute_reply.started":"2024-01-24T03:29:32.474661Z","shell.execute_reply":"2024-01-24T03:29:32.866039Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"targets = ['seizure_vote', 'lpd_vote', 'gpd_vote', 'lrda_vote', 'grda_vote', 'other_vote']\n\nplt.figure(figsize=(15, 10))\nfor i, column in enumerate(targets, 1):\n    plt.subplot(2, 4, i)\n    sns.histplot(train[column], kde=False, bins=30)\n    plt.title(column)\nplt.tight_layout()","metadata":{"execution":{"iopub.status.busy":"2024-01-24T03:29:32.868593Z","iopub.execute_input":"2024-01-24T03:29:32.868889Z","iopub.status.idle":"2024-01-24T03:29:35.543864Z","shell.execute_reply.started":"2024-01-24T03:29:32.868863Z","shell.execute_reply":"2024-01-24T03:29:35.543130Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"correlation_targets = train[targets].corr()\nplt.figure(figsize=(12, 8))\nsns.heatmap(correlation_targets, annot=True, cmap='coolwarm', fmt=\".2f\")\nplt.title('Correlation Matrix of Vote Columns')\nplt.show()\n\nplt.figure(figsize=(12, 10))\nfor i, column in enumerate(targets, 1):\n    plt.subplot(3, 2, i)\n    sns.violinplot(data=train, x='expert_consensus', y=column)\n    plt.title(f'Distribution of {column} by Expert Consensus')\n\nplt.tight_layout()\nplt.show()","metadata":{"execution":{"iopub.status.busy":"2024-01-24T03:29:35.546824Z","iopub.execute_input":"2024-01-24T03:29:35.547675Z","iopub.status.idle":"2024-01-24T03:29:40.521948Z","shell.execute_reply.started":"2024-01-24T03:29:35.547646Z","shell.execute_reply":"2024-01-24T03:29:40.520719Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"sns.pairplot(train[targets])\nplt.suptitle('Pairwise Relationships of Target Votes', y=1.02)\nplt.show()","metadata":{"execution":{"iopub.status.busy":"2024-01-24T03:29:40.523652Z","iopub.execute_input":"2024-01-24T03:29:40.524028Z","iopub.status.idle":"2024-01-24T03:29:56.759194Z","shell.execute_reply.started":"2024-01-24T03:29:40.523992Z","shell.execute_reply":"2024-01-24T03:29:56.757557Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"offset_stats = train[['eeg_label_offset_seconds', 'spectrogram_label_offset_seconds']].describe()\n\nplt.figure(figsize=(12, 6))\nsns.histplot(train['eeg_label_offset_seconds'], bins=30, kde=True)\nplt.title('Distribution of EEG Label Offset Seconds')\nplt.xlabel('EEG Label Offset Seconds')\nplt.ylabel('Count')\nplt.show()\n\nplt.figure(figsize=(12, 6))\nsns.histplot(train['spectrogram_label_offset_seconds'], bins=30, kde=True)\nplt.title('Distribution of Spectrogram Label Offset Seconds')\nplt.xlabel('Spectrogram Label Offset Seconds')\nplt.ylabel('Count')\nplt.show()\n\noffset_stats","metadata":{"execution":{"iopub.status.busy":"2024-01-24T03:29:56.760475Z","iopub.execute_input":"2024-01-24T03:29:56.760752Z","iopub.status.idle":"2024-01-24T03:29:58.544566Z","shell.execute_reply.started":"2024-01-24T03:29:56.760728Z","shell.execute_reply":"2024-01-24T03:29:58.543706Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"total_eegs = len(train['eeg_id'].unique())\ntotal_eegs","metadata":{"execution":{"iopub.status.busy":"2024-01-24T03:29:58.545526Z","iopub.execute_input":"2024-01-24T03:29:58.545781Z","iopub.status.idle":"2024-01-24T03:29:58.557555Z","shell.execute_reply.started":"2024-01-24T03:29:58.545759Z","shell.execute_reply":"2024-01-24T03:29:58.556750Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"all_eeg_label_offset_seconds = sorted(list(train['eeg_label_offset_seconds'].unique()))\nlen(all_eeg_label_offset_seconds), str(all_eeg_label_offset_seconds[0:5]), str(all_eeg_label_offset_seconds[-5:])","metadata":{"execution":{"iopub.status.busy":"2024-01-24T03:29:58.559151Z","iopub.execute_input":"2024-01-24T03:29:58.559498Z","iopub.status.idle":"2024-01-24T03:29:58.569512Z","shell.execute_reply.started":"2024-01-24T03:29:58.559469Z","shell.execute_reply":"2024-01-24T03:29:58.568507Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"all_spectrogram_label_offset_seconds = sorted(list(train['spectrogram_label_offset_seconds'].unique()))\nlen(all_spectrogram_label_offset_seconds), str(all_spectrogram_label_offset_seconds[0:5]), str(all_spectrogram_label_offset_seconds[-5:])","metadata":{"execution":{"iopub.status.busy":"2024-01-24T03:29:58.570865Z","iopub.execute_input":"2024-01-24T03:29:58.571547Z","iopub.status.idle":"2024-01-24T03:29:58.581108Z","shell.execute_reply.started":"2024-01-24T03:29:58.571520Z","shell.execute_reply":"2024-01-24T03:29:58.580295Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"eeg_sub_id_count_per_eeg_id = train.groupby('eeg_id')['eeg_sub_id'].nunique()\nspectrogram_sub_id_count_per_spectrogram_id = train.groupby('spectrogram_id')['spectrogram_sub_id'].nunique()\n\nplt.figure(figsize=(12, 6))\nsns.histplot(eeg_sub_id_count_per_eeg_id, bins=50, kde=True)\nplt.title('EEG Sub-ID Count per EEG ID')\nplt.xlabel('Count of EEG Sub-ID per EEG ID')\nplt.ylabel('Frequency')\nplt.show()\n\nplt.figure(figsize=(12, 6))\nsns.histplot(spectrogram_sub_id_count_per_spectrogram_id, bins=50, kde=True)\nplt.title('Spectrogram Sub-ID Count per Spectrogram ID')\nplt.xlabel('Count of Spectrogram Sub-ID per Spectrogram ID')\nplt.ylabel('Frequency')\nplt.show()","metadata":{"execution":{"iopub.status.busy":"2024-01-24T03:29:58.582279Z","iopub.execute_input":"2024-01-24T03:29:58.582631Z","iopub.status.idle":"2024-01-24T03:29:59.617614Z","shell.execute_reply.started":"2024-01-24T03:29:58.582600Z","shell.execute_reply":"2024-01-24T03:29:59.616595Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"vote_counts_by_consensus = train.groupby('expert_consensus')[targets].sum()\n\nplt.figure(figsize=(12, 8))\nvote_counts_by_consensus.plot(kind='bar', stacked=True)\nplt.title('Overall Vote Counts by Expert Consensus')\nplt.xlabel('Expert Consensus')\nplt.ylabel('Total Votes')\nplt.xticks(rotation=45)\nplt.legend(title='Vote Types')\nplt.show()","metadata":{"execution":{"iopub.status.busy":"2024-01-24T03:29:59.618927Z","iopub.execute_input":"2024-01-24T03:29:59.619334Z","iopub.status.idle":"2024-01-24T03:29:59.975071Z","shell.execute_reply.started":"2024-01-24T03:29:59.619307Z","shell.execute_reply":"2024-01-24T03:29:59.973774Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"cumulative_votes = train.groupby('eeg_label_offset_seconds')[targets].sum().cumsum().reset_index()\n\nplt.figure(figsize=(12, 8))\nfor column in targets:\n    plt.plot(cumulative_votes['eeg_label_offset_seconds'], cumulative_votes[column], label=column)\n\nplt.title('Vote Counts Over EEG Label Offset Seconds')\nplt.xlabel('EEG Label Offset Seconds')\nplt.ylabel('Total Votes')\nplt.legend()\nplt.show()","metadata":{"execution":{"iopub.status.busy":"2024-01-24T03:29:59.976398Z","iopub.execute_input":"2024-01-24T03:29:59.976691Z","iopub.status.idle":"2024-01-24T03:30:00.390657Z","shell.execute_reply.started":"2024-01-24T03:29:59.976665Z","shell.execute_reply":"2024-01-24T03:30:00.389457Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"cumulative_votes = train.groupby('spectrogram_label_offset_seconds')[targets].sum().cumsum().reset_index()\n\nplt.figure(figsize=(12, 8))\nfor column in targets:\n    plt.plot(cumulative_votes['spectrogram_label_offset_seconds'], cumulative_votes[column], label=column)\n\nplt.title('Vote Counts Over Spectrogram Offset Seconds')\nplt.xlabel('EEG Label Offset Seconds')\nplt.ylabel('Total Votes')\nplt.legend()\nplt.show()","metadata":{"execution":{"iopub.status.busy":"2024-01-24T03:30:00.391889Z","iopub.execute_input":"2024-01-24T03:30:00.392210Z","iopub.status.idle":"2024-01-24T03:30:00.816043Z","shell.execute_reply.started":"2024-01-24T03:30:00.392145Z","shell.execute_reply":"2024-01-24T03:30:00.814991Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"cumulative_votes","metadata":{"execution":{"iopub.status.busy":"2024-01-24T03:30:00.817254Z","iopub.execute_input":"2024-01-24T03:30:00.817546Z","iopub.status.idle":"2024-01-24T03:30:00.830296Z","shell.execute_reply.started":"2024-01-24T03:30:00.817521Z","shell.execute_reply":"2024-01-24T03:30:00.829487Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"sorted_data = train.sort_values(by=['eeg_id', 'eeg_sub_id'])\n\nsorted_data['offset_difference'] = sorted_data.groupby('eeg_id')['eeg_label_offset_seconds'].diff()\n\noffset_differences = sorted_data['offset_difference'].dropna()\n\noffset_difference_stats = offset_differences.describe()\n\nplt.figure(figsize=(12, 6))\nsns.histplot(offset_differences, bins=30, kde=True)\nplt.title('Offset Differences within EEG IDs')\nplt.xlabel('Offset Difference (Seconds)')\nplt.ylabel('Frequency')\nplt.show()","metadata":{"execution":{"iopub.status.busy":"2024-01-24T03:30:00.831652Z","iopub.execute_input":"2024-01-24T03:30:00.831867Z","iopub.status.idle":"2024-01-24T03:30:01.606058Z","shell.execute_reply.started":"2024-01-24T03:30:00.831847Z","shell.execute_reply":"2024-01-24T03:30:01.604986Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"sorted_data = train.sort_values(by=['spectrogram_id', 'spectrogram_sub_id'])\n\nsorted_data['offset_difference'] = sorted_data.groupby('spectrogram_id')['spectrogram_label_offset_seconds'].diff()\n\noffset_differences = sorted_data['offset_difference'].dropna()\n\noffset_difference_stats = offset_differences.describe()\n\nplt.figure(figsize=(12, 6))\nsns.histplot(offset_differences, bins=30, kde=True)\nplt.title('Offset Differences within Spectrogram IDs')\nplt.xlabel('Offset Difference (Seconds)')\nplt.ylabel('Frequency')\nplt.show()","metadata":{"execution":{"iopub.status.busy":"2024-01-24T03:30:01.607211Z","iopub.execute_input":"2024-01-24T03:30:01.607498Z","iopub.status.idle":"2024-01-24T03:30:02.421906Z","shell.execute_reply.started":"2024-01-24T03:30:01.607471Z","shell.execute_reply":"2024-01-24T03:30:02.420980Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"sample_patients = train['patient_id'].sample(20, random_state=1).values\nsample_data = train[train['patient_id'].isin(sample_patients)]\n\nfor i, vote_type in enumerate(targets, 1):\n    plt.figure(figsize=(15, 10))\n    sns.boxplot(x='patient_id', y=vote_type, data=sample_data)\n    plt.title(f'Distribution of {vote_type} for Selected Patients')\n    plt.xlabel('Patient ID')\n    plt.ylabel(f'{vote_type} Count')\n    plt.show()","metadata":{"execution":{"iopub.status.busy":"2024-01-24T03:30:02.422954Z","iopub.execute_input":"2024-01-24T03:30:02.423289Z","iopub.status.idle":"2024-01-24T03:30:05.923215Z","shell.execute_reply.started":"2024-01-24T03:30:02.423267Z","shell.execute_reply":"2024-01-24T03:30:05.922059Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"plt.figure(figsize=(15, 10))\n\n\nfor i, patient_id in enumerate(sample_patients, 1):\n    plt.figure(figsize=(15, 10))\n    patient_data = train[train['patient_id'] == patient_id]\n    correlation_matrix = patient_data[targets].corr()\n    sns.heatmap(correlation_matrix, annot=True, cmap='coolwarm', fmt=\".2f\")\n    plt.title(f'Correlation of Votes for Patient ID {patient_id}')\n    plt.show()","metadata":{"execution":{"iopub.status.busy":"2024-01-24T03:30:05.924451Z","iopub.execute_input":"2024-01-24T03:30:05.925223Z","iopub.status.idle":"2024-01-24T03:30:13.833403Z","shell.execute_reply.started":"2024-01-24T03:30:05.925193Z","shell.execute_reply":"2024-01-24T03:30:13.832494Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"total_votes_per_pat = train.groupby('patient_id')[targets].sum().sum(axis=1)\nnormalized_votes = train.groupby('patient_id')[targets].sum().div(total_votes_per_pat, axis=0)\nmean_vote_ratio = normalized_votes.mean()\nprint( mean_vote_ratio )","metadata":{"execution":{"iopub.status.busy":"2024-01-24T03:30:13.834407Z","iopub.execute_input":"2024-01-24T03:30:13.834688Z","iopub.status.idle":"2024-01-24T03:30:13.853247Z","shell.execute_reply.started":"2024-01-24T03:30:13.834664Z","shell.execute_reply":"2024-01-24T03:30:13.852201Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"## **Its @cdeotte idea** - https://www.kaggle.com/competitions/hms-harmful-brain-activity-classification/discussion/467021","metadata":{}},{"cell_type":"code","source":"gap = 1 - sum([round(v,6) for _, v in mean_vote_ratio.items()])\nprint(gap)\nmean_vote_ratio['other_vote'] += gap","metadata":{"execution":{"iopub.status.busy":"2024-01-24T03:30:13.854698Z","iopub.execute_input":"2024-01-24T03:30:13.855321Z","iopub.status.idle":"2024-01-24T03:30:13.860914Z","shell.execute_reply.started":"2024-01-24T03:30:13.855291Z","shell.execute_reply":"2024-01-24T03:30:13.860096Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"sum([round(v,5) for _, v in mean_vote_ratio.items()])","metadata":{"execution":{"iopub.status.busy":"2024-01-24T03:30:13.861934Z","iopub.execute_input":"2024-01-24T03:30:13.862772Z","iopub.status.idle":"2024-01-24T03:30:13.873886Z","shell.execute_reply.started":"2024-01-24T03:30:13.862747Z","shell.execute_reply":"2024-01-24T03:30:13.873092Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"mean_vote_ratio","metadata":{"execution":{"iopub.status.busy":"2024-01-24T03:30:13.879035Z","iopub.execute_input":"2024-01-24T03:30:13.880162Z","iopub.status.idle":"2024-01-24T03:30:13.887503Z","shell.execute_reply.started":"2024-01-24T03:30:13.880124Z","shell.execute_reply":"2024-01-24T03:30:13.886501Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"sub = pd.read_csv(\"/kaggle/input/hms-harmful-brain-activity-classification/sample_submission.csv\")\nfor target in targets:\n    sub[target] = mean_vote_ratio[target]\nsub","metadata":{"execution":{"iopub.status.busy":"2024-01-24T03:30:13.888912Z","iopub.execute_input":"2024-01-24T03:30:13.889184Z","iopub.status.idle":"2024-01-24T03:30:13.912451Z","shell.execute_reply.started":"2024-01-24T03:30:13.889159Z","shell.execute_reply":"2024-01-24T03:30:13.911575Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"sub.to_csv(\"/kaggle/working/submission.csv\", index=False)","metadata":{"execution":{"iopub.status.busy":"2024-01-24T03:30:13.913736Z","iopub.execute_input":"2024-01-24T03:30:13.914285Z","iopub.status.idle":"2024-01-24T03:30:13.920947Z","shell.execute_reply.started":"2024-01-24T03:30:13.914255Z","shell.execute_reply":"2024-01-24T03:30:13.920262Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]}]}