{"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":"nvidiaTeslaT4","dataSources":[{"sourceId":59093,"databundleVersionId":7469972,"sourceType":"competition"},{"sourceId":813380,"sourceType":"datasetVersion","datasetId":427362},{"sourceId":2378330,"sourceType":"datasetVersion","datasetId":492658},{"sourceId":7392733,"sourceType":"datasetVersion","datasetId":4297749},{"sourceId":7402356,"sourceType":"datasetVersion","datasetId":4304475},{"sourceId":7754261,"sourceType":"datasetVersion","datasetId":4532886},{"sourceId":8028982,"sourceType":"datasetVersion","datasetId":4533761},{"sourceId":8060274,"sourceType":"datasetVersion","datasetId":4721546},{"sourceId":7987619,"sourceType":"datasetVersion","datasetId":4417235},{"sourceId":7450712,"sourceType":"datasetVersion","datasetId":4336944},{"sourceId":7752462,"sourceType":"datasetVersion","datasetId":4382744},{"sourceId":7601534,"sourceType":"datasetVersion","datasetId":4425227},{"sourceId":7810897,"sourceType":"datasetVersion","datasetId":4574876},{"sourceId":7805987,"sourceType":"datasetVersion","datasetId":4571300},{"sourceId":7403069,"sourceType":"datasetVersion","datasetId":4304949},{"sourceId":158958765,"sourceType":"kernelVersion"},{"sourceId":164614938,"sourceType":"kernelVersion"},{"sourceId":165447673,"sourceType":"kernelVersion"},{"sourceId":165876189,"sourceType":"kernelVersion"},{"sourceId":160674831,"sourceType":"kernelVersion"},{"sourceId":160700706,"sourceType":"kernelVersion"}],"dockerImageVersionId":30648,"isInternetEnabled":false,"language":"python","sourceType":"notebook","isGpuEnabled":true}},"nbformat_minor":4,"nbformat":4,"cells":[{"cell_type":"code","source":"import tensorflow as tf\nprint(tf.__version__)","metadata":{"execution":{"iopub.status.busy":"2024-04-08T05:52:31.540545Z","iopub.execute_input":"2024-04-08T05:52:31.541232Z","iopub.status.idle":"2024-04-08T05:52:50.637570Z","shell.execute_reply.started":"2024-04-08T05:52:31.541196Z","shell.execute_reply":"2024-04-08T05:52:50.636598Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"!pip install --no-index --find-links=/kaggle/input/tf-efficientnet-whl-files /kaggle/input/tf-efficientnet-whl-files/efficientnet-1.1.1-py3-none-any.whl","metadata":{"execution":{"iopub.status.busy":"2024-04-08T05:53:09.719059Z","iopub.execute_input":"2024-04-08T05:53:09.719682Z","iopub.status.idle":"2024-04-08T05:53:24.152605Z","shell.execute_reply.started":"2024-04-08T05:53:09.719648Z","shell.execute_reply":"2024-04-08T05:53:24.151443Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"%%time\n!nvidia-smi\n\n# Installation of RAPIDS to Use cuSignal\n!cp ../input/rapids/rapids.0.17.0 /opt/conda/envs/rapids.tar.gz\n!cd /opt/conda/envs/ && tar -xzvf rapids.tar.gz > /dev/null\n!rm /opt/conda/envs/rapids.tar.gz\n\nimport sys\nsys.path += [\"/opt/conda/envs/rapids/lib/python3.7/site-packages\"]\nsys.path += [\"/opt/conda/envs/rapids/lib/python3.7\"]\nsys.path += [\"/opt/conda/envs/rapids/lib\"]\n!cp /opt/conda/envs/rapids/lib/libxgboost.so /opt/conda/lib/\n\nimport cupy as cp\nimport cusignal","metadata":{"execution":{"iopub.status.busy":"2024-04-08T05:53:34.181603Z","iopub.execute_input":"2024-04-08T05:53:34.181985Z","iopub.status.idle":"2024-04-08T05:55:10.957634Z","shell.execute_reply.started":"2024-04-08T05:53:34.181950Z","shell.execute_reply":"2024-04-08T05:55:10.956531Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"!python /kaggle/input/111111/submit.py","metadata":{"execution":{"iopub.status.busy":"2024-04-08T06:00:35.419851Z","iopub.execute_input":"2024-04-08T06:00:35.420678Z","iopub.status.idle":"2024-04-08T06:03:06.360501Z","shell.execute_reply.started":"2024-04-08T06:00:35.420617Z","shell.execute_reply":"2024-04-08T06:03:06.359467Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"!python /kaggle/input/111111/submit2.py","metadata":{"execution":{"iopub.status.busy":"2024-04-08T06:13:48.557987Z","iopub.execute_input":"2024-04-08T06:13:48.558402Z","iopub.status.idle":"2024-04-08T06:14:14.695650Z","shell.execute_reply.started":"2024-04-08T06:13:48.558356Z","shell.execute_reply":"2024-04-08T06:14:14.694286Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"import pandas as pd\nsub0 = pd.read_csv('/kaggle/working/submission_m1.csv') #036\nsub1 = pd.read_csv('/kaggle/working/submission_m3.csv') #034\nsub2 = pd.read_csv('/kaggle/working/submission_u2.csv') #030\nsub3 = pd.read_csv('/kaggle/working/submission_n1.csv') #031\nsub4 = pd.read_csv('/kaggle/working/submission_w1.csv') #038","metadata":{"execution":{"iopub.status.busy":"2024-04-08T06:19:49.825760Z","iopub.execute_input":"2024-04-08T06:19:49.826606Z","iopub.status.idle":"2024-04-08T06:19:49.842517Z","shell.execute_reply.started":"2024-04-08T06:19:49.826564Z","shell.execute_reply":"2024-04-08T06:19:49.841614Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"res = [sub0, sub1, sub2, sub3, sub4]","metadata":{"execution":{"iopub.status.busy":"2024-04-08T06:36:45.173560Z","iopub.execute_input":"2024-04-08T06:36:45.174670Z","iopub.status.idle":"2024-04-08T06:36:45.179072Z","shell.execute_reply.started":"2024-04-08T06:36:45.174631Z","shell.execute_reply":"2024-04-08T06:36:45.178085Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# total_weight = sum([1/0.36, 1/0.34, 1/0.30, 1/0.31, 1/0.38])\n# total_weight","metadata":{"execution":{"iopub.status.busy":"2024-04-08T06:34:04.276169Z","iopub.execute_input":"2024-04-08T06:34:04.276879Z","iopub.status.idle":"2024-04-08T06:34:04.285108Z","shell.execute_reply.started":"2024-04-08T06:34:04.276842Z","shell.execute_reply":"2024-04-08T06:34:04.284104Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# weights = [i/total_weight for i in [1/0.36, 1/0.34, 1/0.30, 1/0.31, 1/0.38]]\n# weights\nweights = [0.1, 0.15, 0.4, 0.3, 0.05]","metadata":{"execution":{"iopub.status.busy":"2024-04-08T06:34:51.817540Z","iopub.execute_input":"2024-04-08T06:34:51.817878Z","iopub.status.idle":"2024-04-08T06:34:51.825736Z","shell.execute_reply.started":"2024-04-08T06:34:51.817853Z","shell.execute_reply":"2024-04-08T06:34:51.824852Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"sum(weights)","metadata":{"execution":{"iopub.status.busy":"2024-04-08T06:35:00.217824Z","iopub.execute_input":"2024-04-08T06:35:00.218161Z","iopub.status.idle":"2024-04-08T06:35:00.224315Z","shell.execute_reply.started":"2024-04-08T06:35:00.218136Z","shell.execute_reply":"2024-04-08T06:35:00.223297Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"submission=pd.read_csv(\"/kaggle/input/hms-harmful-brain-activity-classification/sample_submission.csv\")\nlabels=['seizure','lpd','gpd','lrda','grda','other']\nfor i in range(len(labels)):\n    submission[f'{labels[i]}_vote'] = 0\n    for j in range(len(res)):\n        submission[f'{labels[i]}_vote'] += res[j][f'{labels[i]}_vote']*weights[j]\nsubmission.to_csv(\"submission.csv\",index=None)\ndisplay(submission.head())","metadata":{"execution":{"iopub.status.busy":"2024-04-08T06:37:46.513784Z","iopub.execute_input":"2024-04-08T06:37:46.514515Z","iopub.status.idle":"2024-04-08T06:37:46.569103Z","shell.execute_reply.started":"2024-04-08T06:37:46.514481Z","shell.execute_reply":"2024-04-08T06:37:46.568219Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]}]}