{"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":"https://www.kaggle.com/code/coderrkj/rsna-atd-cnn-tpu-infer-corrections/notebook","metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19"}},{"cell_type":"markdown","source":"https://www.kaggle.com/code/awsaf49/rsna-atd-2-5d-series-image-infer/input","metadata":{}},{"cell_type":"markdown","source":"https://www.kaggle.com/code/jakebrusca/rsna23-weighted-mean-baseline/input","metadata":{}},{"cell_type":"markdown","source":"https://www.kaggle.com/code/metric/rsna-trauma-metric/notebook","metadata":{}},{"cell_type":"markdown","source":"https://www.kaggle.com/code/parhammostame/interactive-3d-visualization-of-organ-segmentation","metadata":{}},{"cell_type":"markdown","source":"https://www.kaggle.com/code/mirenaborisova/rsna-1","metadata":{}},{"cell_type":"markdown","source":"https://www.kaggle.com/code/parhammostame/real-3d-interactive-visualization-of-organs?scriptVersionId=140614710","metadata":{}},{"cell_type":"markdown","source":"https://www.kaggle.com/code/alenic/dataset-size-reduction-400gb-to-7-5gb/notebook","metadata":{}},{"cell_type":"code","source":"import warnings\nwarnings.simplefilter('ignore')\n\nimport pandas as pd\n\npd.set_option('display.max_columns', None)","metadata":{"execution":{"iopub.status.busy":"2023-09-18T18:31:36.329817Z","iopub.execute_input":"2023-09-18T18:31:36.330506Z","iopub.status.idle":"2023-09-18T18:31:36.367722Z","shell.execute_reply.started":"2023-09-18T18:31:36.330443Z","shell.execute_reply":"2023-09-18T18:31:36.366184Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# sub_3_v1_0_87_bh = (0.81597793 + 0.9726102 + 0.8109809) / 3\n# sub_3_v1_0_87_bi = (0.7360883 + 0.1095593 + 0.75607634) / 3\n\n# sub_3_v1_0_87_eh = (0.6329648 + 0.905151 + 0.70833457) / 3\n# sub_3_v1_0_87_ei = (7.340704 + 1.8969798 + 5.8333087) / 3\n\n# sub_3_v1_0_87_kh = (0.9225431 + 0.99220324 + 0.9268111) / 3\n# sub_3_v1_0_87_kl = (0.1714894 + 0.01588829 + 0.13339157) / 3\n# sub_3_v1_0_87_khi = (0.20750692 + 0.022948269 + 0.23904595) / 3\n\n# sub_3_v1_0_87_lh = (0.8311802 + 0.91733295 + 0.8131598) / 3\n# sub_3_v1_0_87_ll = (0.6392951 + 0.3300555 + 0.7174159) / 3\n# sub_3_v1_0_87_lhi = (0.05397627 + 0.0009195256 + 0.044917163) / 3\n\n# sub_3_v1_0_87_sh = (0.9540673 + 0.98278946 + 0.9625712) / 3\n# sub_3_v1_0_87_sl = (0.07486205 + 0.022877565 + 0.05111965) / 3\n# sub_3_v1_0_87_shi = (0.16330297 + 0.06894679 + 0.14789322) / 3","metadata":{"execution":{"iopub.status.busy":"2023-09-18T18:31:36.369829Z","iopub.execute_input":"2023-09-18T18:31:36.37042Z","iopub.status.idle":"2023-09-18T18:31:36.374971Z","shell.execute_reply.started":"2023-09-18T18:31:36.37039Z","shell.execute_reply":"2023-09-18T18:31:36.373878Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# sub_3_v2_0_87_bh = (0.81205726 + 0.96793693 + 0.8070843) / 3\n# sub_3_v2_0_87_bi = (0.89094853 + 0.13260868 + 0.9151414) / 3\n\n# sub_3_v2_0_87_eh = (0.62992346 + 0.9008019 + 0.7049312) / 3\n# sub_3_v2_0_87_ei = (7.6403337 + 1.9744098 + 6.0714087) / 3\n\n# sub_3_v2_0_87_kh = (0.91811043 + 0.9874359 + 0.9223579) / 3\n# sub_3_v2_0_87_kl = (0.1220213 + 0.011305126 + 0.09491318) / 3\n# sub_3_v2_0_87_khi = (0.167442 + 0.018517457 + 0.19289139) / 3\n\n# sub_3_v2_0_87_lh = (0.8271865 + 0.9129253 + 0.80925274) / 3\n# sub_3_v2_0_87_ll = (0.45488292 + 0.23484711 + 0.510469) / 3\n# sub_3_v2_0_87_lhi = (0.043554652 + 0.0007419853 + 0.03624464) / 3\n\n# sub_3_v2_0_87_sh = (0.94948316 + 0.9780673 + 0.9579462) / 3\n# sub_3_v2_0_87_sl = (0.053267226 + 0.016278263 + 0.03637357) / 3\n# sub_3_v2_0_87_shi = (0.07746422 + 0.032705523 + 0.07015444) / 3","metadata":{"execution":{"iopub.status.busy":"2023-09-18T18:31:36.398885Z","iopub.execute_input":"2023-09-18T18:31:36.399848Z","iopub.status.idle":"2023-09-18T18:31:36.404618Z","shell.execute_reply.started":"2023-09-18T18:31:36.399808Z","shell.execute_reply":"2023-09-18T18:31:36.40357Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train = pd.read_csv('/kaggle/input/rsna-2023-abdominal-trauma-detection/train.csv')\ntrain","metadata":{"execution":{"iopub.status.busy":"2023-09-18T18:31:36.430686Z","iopub.execute_input":"2023-09-18T18:31:36.431324Z","iopub.status.idle":"2023-09-18T18:31:36.481358Z","shell.execute_reply.started":"2023-09-18T18:31:36.431289Z","shell.execute_reply":"2023-09-18T18:31:36.47947Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"features = [col for col in train.columns if col not in ['patient_id', 'any_injury']]","metadata":{"execution":{"iopub.status.busy":"2023-09-18T18:31:36.483202Z","iopub.execute_input":"2023-09-18T18:31:36.483795Z","iopub.status.idle":"2023-09-18T18:31:36.489702Z","shell.execute_reply.started":"2023-09-18T18:31:36.483762Z","shell.execute_reply":"2023-09-18T18:31:36.488189Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"sample_submission = pd.read_csv('/kaggle/input/rsna-2023-abdominal-trauma-detection/sample_submission.csv')\nsample_submission","metadata":{"execution":{"iopub.status.busy":"2023-09-18T18:31:36.491266Z","iopub.execute_input":"2023-09-18T18:31:36.491622Z","iopub.status.idle":"2023-09-18T18:31:36.52388Z","shell.execute_reply.started":"2023-09-18T18:31:36.491594Z","shell.execute_reply":"2023-09-18T18:31:36.522697Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"ss_mean = sample_submission.copy()\nss_mean[features] = train[features].mean()\nss_mean","metadata":{"execution":{"iopub.status.busy":"2023-09-18T18:31:36.526486Z","iopub.execute_input":"2023-09-18T18:31:36.526797Z","iopub.status.idle":"2023-09-18T18:31:36.555743Z","shell.execute_reply.started":"2023-09-18T18:31:36.526776Z","shell.execute_reply":"2023-09-18T18:31:36.55457Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"sample_submission","metadata":{"execution":{"iopub.status.busy":"2023-09-18T18:31:36.557292Z","iopub.execute_input":"2023-09-18T18:31:36.557949Z","iopub.status.idle":"2023-09-18T18:31:36.57536Z","shell.execute_reply.started":"2023-09-18T18:31:36.557917Z","shell.execute_reply":"2023-09-18T18:31:36.574149Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"corr = train[features].corr()","metadata":{"execution":{"iopub.status.busy":"2023-09-18T18:31:36.577568Z","iopub.execute_input":"2023-09-18T18:31:36.578492Z","iopub.status.idle":"2023-09-18T18:31:36.587916Z","shell.execute_reply.started":"2023-09-18T18:31:36.578464Z","shell.execute_reply":"2023-09-18T18:31:36.586618Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# corr.bowel_healthy[corr['bowel_healthy'] > 0].sort_values()","metadata":{"execution":{"iopub.status.busy":"2023-09-18T18:31:36.589708Z","iopub.execute_input":"2023-09-18T18:31:36.590257Z","iopub.status.idle":"2023-09-18T18:31:36.596996Z","shell.execute_reply.started":"2023-09-18T18:31:36.59022Z","shell.execute_reply":"2023-09-18T18:31:36.595748Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"sample_submission['bowel_healthy'] = ss_mean['liver_high'] * 0.020425 + \\\n                                     ss_mean['kidney_healthy'] * 0.022169 + \\\n                                     ss_mean['liver_healthy'] * 0.055579 + \\\n                                     ss_mean['spleen_healthy'] * 0.062705 + \\\n                                     ss_mean['extravasation_healthy'] * 0.128573 + \\\n                                     ss_mean['bowel_healthy']","metadata":{"execution":{"iopub.status.busy":"2023-09-18T18:31:36.598577Z","iopub.execute_input":"2023-09-18T18:31:36.598961Z","iopub.status.idle":"2023-09-18T18:31:36.610793Z","shell.execute_reply.started":"2023-09-18T18:31:36.598929Z","shell.execute_reply":"2023-09-18T18:31:36.609986Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# corr.bowel_injury[corr['bowel_injury'] > 0].sort_values()","metadata":{"execution":{"iopub.status.busy":"2023-09-18T18:31:36.612447Z","iopub.execute_input":"2023-09-18T18:31:36.613516Z","iopub.status.idle":"2023-09-18T18:31:36.626707Z","shell.execute_reply.started":"2023-09-18T18:31:36.61346Z","shell.execute_reply":"2023-09-18T18:31:36.62508Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"sample_submission['bowel_injury'] = ss_mean['kidney_low'] * 0.007934 + \\\n                                    ss_mean['kidney_high'] * 0.025537 + \\\n                                    ss_mean['spleen_high'] * 0.029627 + \\\n                                    ss_mean['spleen_low'] * 0.055063 + \\\n                                    ss_mean['liver_low'] * 0.071536 + \\\n                                    ss_mean['extravasation_injury'] * 0.128573 + \\\n                                    ss_mean['bowel_injury']","metadata":{"execution":{"iopub.status.busy":"2023-09-18T18:31:36.628326Z","iopub.execute_input":"2023-09-18T18:31:36.629486Z","iopub.status.idle":"2023-09-18T18:31:36.642646Z","shell.execute_reply.started":"2023-09-18T18:31:36.629438Z","shell.execute_reply":"2023-09-18T18:31:36.641212Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# corr.extravasation_healthy[corr['extravasation_healthy'] > 0].sort_values()","metadata":{"execution":{"iopub.status.busy":"2023-09-18T18:31:36.644486Z","iopub.execute_input":"2023-09-18T18:31:36.644867Z","iopub.status.idle":"2023-09-18T18:31:36.65564Z","shell.execute_reply.started":"2023-09-18T18:31:36.644835Z","shell.execute_reply":"2023-09-18T18:31:36.654225Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"sample_submission['extravasation_healthy'] = ss_mean['spleen_low'] * 0.008814 + \\\n                                             ss_mean['liver_healthy'] * 0.062834 + \\\n                                             ss_mean['kidney_healthy'] * 0.102861 + \\\n                                             ss_mean['bowel_healthy'] * 0.128573 + \\\n                                             ss_mean['spleen_healthy'] * 0.129867 + \\\n                                             ss_mean['extravasation_healthy']","metadata":{"execution":{"iopub.status.busy":"2023-09-18T18:31:36.656981Z","iopub.execute_input":"2023-09-18T18:31:36.657619Z","iopub.status.idle":"2023-09-18T18:31:36.673164Z","shell.execute_reply.started":"2023-09-18T18:31:36.657584Z","shell.execute_reply":"2023-09-18T18:31:36.671743Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# corr.extravasation_injury[corr['extravasation_injury'] > 0].sort_values()","metadata":{"execution":{"iopub.status.busy":"2023-09-18T18:31:36.675767Z","iopub.execute_input":"2023-09-18T18:31:36.676141Z","iopub.status.idle":"2023-09-18T18:31:36.686964Z","shell.execute_reply.started":"2023-09-18T18:31:36.676088Z","shell.execute_reply":"2023-09-18T18:31:36.68536Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"sample_submission['extravasation_injury'] = ss_mean['liver_low'] * 0.008814 + \\\n                                            ss_mean['kidney_low'] * 0.062834 + \\\n                                            ss_mean['liver_high'] * 0.102861 + \\\n                                            ss_mean['kidney_high'] * 0.128573 + \\\n                                            ss_mean['bowel_injury'] * 0.129867 + \\\n                                            ss_mean['spleen_high'] * 0.199535 + \\\n                                            ss_mean['extravasation_injury']","metadata":{"execution":{"iopub.status.busy":"2023-09-18T18:31:36.689264Z","iopub.execute_input":"2023-09-18T18:31:36.689711Z","iopub.status.idle":"2023-09-18T18:31:36.710375Z","shell.execute_reply.started":"2023-09-18T18:31:36.689639Z","shell.execute_reply":"2023-09-18T18:31:36.709056Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# corr.kidney_healthy[corr['kidney_healthy'] > 0].sort_values()","metadata":{"execution":{"iopub.status.busy":"2023-09-18T18:31:36.712435Z","iopub.execute_input":"2023-09-18T18:31:36.713177Z","iopub.status.idle":"2023-09-18T18:31:36.723226Z","shell.execute_reply.started":"2023-09-18T18:31:36.71314Z","shell.execute_reply":"2023-09-18T18:31:36.722432Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"sample_submission['kidney_healthy'] = ss_mean['bowel_healthy'] * 0.022169 + \\\n                                      ss_mean['extravasation_healthy'] * 0.102861 + \\\n                                      ss_mean['spleen_healthy'] * 0.122905 + \\\n                                      ss_mean['liver_healthy'] * 0.159386 + \\\n                                      ss_mean['kidney_healthy']","metadata":{"execution":{"iopub.status.busy":"2023-09-18T18:31:36.724988Z","iopub.execute_input":"2023-09-18T18:31:36.725397Z","iopub.status.idle":"2023-09-18T18:31:36.739801Z","shell.execute_reply.started":"2023-09-18T18:31:36.725367Z","shell.execute_reply":"2023-09-18T18:31:36.738702Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# corr.kidney_low[corr['kidney_low'] > 0].sort_values()","metadata":{"execution":{"iopub.status.busy":"2023-09-18T18:31:36.741025Z","iopub.execute_input":"2023-09-18T18:31:36.741366Z","iopub.status.idle":"2023-09-18T18:31:36.753883Z","shell.execute_reply.started":"2023-09-18T18:31:36.741341Z","shell.execute_reply":"2023-09-18T18:31:36.75286Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"sample_submission['kidney_low'] = ss_mean['bowel_injury'] * 0.007934 + \\\n                                  ss_mean['spleen_low'] * 0.025940 + \\\n                                  ss_mean['extravasation_injury'] * 0.053393 + \\\n                                  ss_mean['liver_low'] * 0.058759 + \\\n                                  ss_mean['spleen_high'] * 0.065236 + \\\n                                  ss_mean['liver_high'] * 0.082065 + \\\n                                  ss_mean['kidney_low']","metadata":{"execution":{"iopub.status.busy":"2023-09-18T18:31:36.755876Z","iopub.execute_input":"2023-09-18T18:31:36.756357Z","iopub.status.idle":"2023-09-18T18:31:36.771275Z","shell.execute_reply.started":"2023-09-18T18:31:36.756331Z","shell.execute_reply":"2023-09-18T18:31:36.77014Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# corr.kidney_high[corr['kidney_high'] > 0].sort_values()","metadata":{"execution":{"iopub.status.busy":"2023-09-18T18:31:36.772579Z","iopub.execute_input":"2023-09-18T18:31:36.773168Z","iopub.status.idle":"2023-09-18T18:31:36.784692Z","shell.execute_reply.started":"2023-09-18T18:31:36.77314Z","shell.execute_reply":"2023-09-18T18:31:36.783452Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"sample_submission['kidney_high'] = ss_mean['bowel_injury'] * 0.025537 + \\\n                                  ss_mean['liver_high'] * 0.058292 + \\\n                                  ss_mean['spleen_low'] * 0.061172 + \\\n                                  ss_mean['extravasation_injury'] * 0.096931 + \\\n                                  ss_mean['spleen_high'] * 0.098676 + \\\n                                  ss_mean['liver_high'] * 0.124043 + \\\n                                  ss_mean['kidney_high']","metadata":{"execution":{"iopub.status.busy":"2023-09-18T18:31:36.786423Z","iopub.execute_input":"2023-09-18T18:31:36.786811Z","iopub.status.idle":"2023-09-18T18:31:36.800257Z","shell.execute_reply.started":"2023-09-18T18:31:36.786776Z","shell.execute_reply":"2023-09-18T18:31:36.798958Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# corr.liver_healthy[corr['liver_healthy'] > 0].sort_values()","metadata":{"execution":{"iopub.status.busy":"2023-09-18T18:31:36.802685Z","iopub.execute_input":"2023-09-18T18:31:36.803035Z","iopub.status.idle":"2023-09-18T18:31:36.819685Z","shell.execute_reply.started":"2023-09-18T18:31:36.803006Z","shell.execute_reply":"2023-09-18T18:31:36.818366Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"sample_submission['liver_healthy'] = ss_mean['spleen_healthy'] * 0.049483 + \\\n                                     ss_mean['bowel_healthy'] * 0.055579 + \\\n                                     ss_mean['extravasation_healthy'] * 0.062834 + \\\n                                     ss_mean['kidney_healthy'] * 0.159386 + \\\n                                     ss_mean['liver_healthy']","metadata":{"execution":{"iopub.status.busy":"2023-09-18T18:31:36.820854Z","iopub.execute_input":"2023-09-18T18:31:36.821291Z","iopub.status.idle":"2023-09-18T18:31:36.835355Z","shell.execute_reply.started":"2023-09-18T18:31:36.821262Z","shell.execute_reply":"2023-09-18T18:31:36.834641Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# corr.liver_low[corr['liver_low'] > 0].sort_values()","metadata":{"execution":{"iopub.status.busy":"2023-09-18T18:31:36.836413Z","iopub.execute_input":"2023-09-18T18:31:36.836811Z","iopub.status.idle":"2023-09-18T18:31:36.84814Z","shell.execute_reply.started":"2023-09-18T18:31:36.836789Z","shell.execute_reply":"2023-09-18T18:31:36.847319Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"sample_submission['liver_low'] = ss_mean['extravasation_injury'] * 0.021517 + \\\n                                 ss_mean['spleen_high'] * 0.022673 + \\\n                                 ss_mean['spleen_low'] * 0.031460 + \\\n                                 ss_mean['kidney_low'] * 0.058759 + \\\n                                 ss_mean['bowel_injury'] * 0.071536 + \\\n                                 ss_mean['kidney_high'] * 0.124043 + \\\n                                 ss_mean['liver_low']","metadata":{"execution":{"iopub.status.busy":"2023-09-18T18:31:36.849362Z","iopub.execute_input":"2023-09-18T18:31:36.849791Z","iopub.status.idle":"2023-09-18T18:31:36.866092Z","shell.execute_reply.started":"2023-09-18T18:31:36.849766Z","shell.execute_reply":"2023-09-18T18:31:36.865244Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# corr.liver_high[corr['liver_high'] > 0].sort_values()","metadata":{"execution":{"iopub.status.busy":"2023-09-18T18:31:36.868307Z","iopub.execute_input":"2023-09-18T18:31:36.868777Z","iopub.status.idle":"2023-09-18T18:31:36.879062Z","shell.execute_reply.started":"2023-09-18T18:31:36.868751Z","shell.execute_reply":"2023-09-18T18:31:36.877906Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"sample_submission['liver_high'] = ss_mean['bowel_healthy'] * 0.020425 + \\\n                                  ss_mean['spleen_low'] * 0.038325 + \\\n                                  ss_mean['kidney_high'] * 0.058292 + \\\n                                  ss_mean['kidney_low'] * 0.082065 + \\\n                                  ss_mean['extravasation_injury'] * 0.094288 + \\\n                                  ss_mean['liver_high']","metadata":{"execution":{"iopub.status.busy":"2023-09-18T18:31:36.880495Z","iopub.execute_input":"2023-09-18T18:31:36.881152Z","iopub.status.idle":"2023-09-18T18:31:36.897617Z","shell.execute_reply.started":"2023-09-18T18:31:36.881127Z","shell.execute_reply":"2023-09-18T18:31:36.896423Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# corr.spleen_healthy[corr['spleen_healthy'] > 0].sort_values()","metadata":{"execution":{"iopub.status.busy":"2023-09-18T18:31:36.899003Z","iopub.execute_input":"2023-09-18T18:31:36.899699Z","iopub.status.idle":"2023-09-18T18:31:36.910091Z","shell.execute_reply.started":"2023-09-18T18:31:36.899673Z","shell.execute_reply":"2023-09-18T18:31:36.908777Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"sample_submission['spleen_healthy'] = ss_mean['liver_healthy'] * 0.049483 + \\\n                                      ss_mean['bowel_healthy'] * 0.062705 + \\\n                                      ss_mean['kidney_healthy'] * 0.122905 + \\\n                                      ss_mean['extravasation_healthy'] * 0.129867 + \\\n                                      ss_mean['spleen_healthy']","metadata":{"execution":{"iopub.status.busy":"2023-09-18T18:31:36.911466Z","iopub.execute_input":"2023-09-18T18:31:36.911749Z","iopub.status.idle":"2023-09-18T18:31:36.928935Z","shell.execute_reply.started":"2023-09-18T18:31:36.911725Z","shell.execute_reply":"2023-09-18T18:31:36.927693Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# corr.spleen_low[corr['spleen_low'] > 0].sort_values()","metadata":{"execution":{"iopub.status.busy":"2023-09-18T18:31:36.929944Z","iopub.execute_input":"2023-09-18T18:31:36.930448Z","iopub.status.idle":"2023-09-18T18:31:36.941574Z","shell.execute_reply.started":"2023-09-18T18:31:36.930421Z","shell.execute_reply":"2023-09-18T18:31:36.940519Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"sample_submission['spleen_low'] = ss_mean['extravasation_healthy'] * 0.008814 + \\\n                                  ss_mean['kidney_low'] * 0.025940 + \\\n                                  ss_mean['liver_low'] * 0.031460 + \\\n                                  ss_mean['liver_high'] * 0.038325 + \\\n                                  ss_mean['bowel_injury'] * 0.055063 + \\\n                                  ss_mean['kidney_high'] * 0.061172 + \\\n                                  ss_mean['spleen_low']","metadata":{"execution":{"iopub.status.busy":"2023-09-18T18:31:36.942809Z","iopub.execute_input":"2023-09-18T18:31:36.94326Z","iopub.status.idle":"2023-09-18T18:31:36.960204Z","shell.execute_reply.started":"2023-09-18T18:31:36.943235Z","shell.execute_reply":"2023-09-18T18:31:36.958592Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# corr.spleen_high[corr['spleen_high'] > 0].sort_values()","metadata":{"execution":{"iopub.status.busy":"2023-09-18T18:31:36.961904Z","iopub.execute_input":"2023-09-18T18:31:36.962491Z","iopub.status.idle":"2023-09-18T18:31:36.973403Z","shell.execute_reply.started":"2023-09-18T18:31:36.962459Z","shell.execute_reply":"2023-09-18T18:31:36.97242Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"sample_submission['spleen_high'] = ss_mean['liver_low'] * 0.022673 + \\\n                                   ss_mean['bowel_injury'] * 0.029627 + \\\n                                   ss_mean['kidney_low'] * 0.065236 + \\\n                                   ss_mean['kidney_high'] * 0.098676 + \\\n                                   ss_mean['extravasation_injury'] * 0.199535 + \\\n                                   ss_mean['spleen_high']","metadata":{"execution":{"iopub.status.busy":"2023-09-18T18:31:36.97619Z","iopub.execute_input":"2023-09-18T18:31:36.976657Z","iopub.status.idle":"2023-09-18T18:31:36.991194Z","shell.execute_reply.started":"2023-09-18T18:31:36.976631Z","shell.execute_reply":"2023-09-18T18:31:36.989673Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# sample_submission.bowel_healthy = sample_submission.bowel_healthy * 0.1 + sub_3_v1_0_87_bh * 0.1 + sub_3_v2_0_87_bh * 0.8\n# sample_submission.bowel_injury = sample_submission.bowel_injury * 0.1 + sub_3_v1_0_87_bi * 0.1 + sub_3_v2_0_87_bi * 0.8\n\n# sample_submission.extravasation_healthy = sample_submission.extravasation_healthy * 0.1 + sub_3_v1_0_87_eh * 0.1 + sub_3_v2_0_87_eh * 0.8\n# sample_submission.extravasation_injury = sample_submission.extravasation_injury * 0.1 + sub_3_v1_0_87_ei * 0.1 + sub_3_v2_0_87_ei * 0.8\n\n# sample_submission.kidney_healthy = sample_submission.kidney_healthy * 0.1 + sub_3_v1_0_87_kh * 0.1 + sub_3_v2_0_87_kh * 0.8\n# sample_submission.kidney_low = sample_submission.kidney_low * 0.1 + sub_3_v1_0_87_kl * 0.1 + sub_3_v2_0_87_kl * 0.8\n# sample_submission.kidney_high = sample_submission.kidney_high * 0.1 + sub_3_v1_0_87_khi* 0.1 + sub_3_v2_0_87_khi * 0.8\n\n# sample_submission.liver_healthy = sample_submission.liver_healthy * 0.1 + sub_3_v1_0_87_lh * 0.1 + sub_3_v2_0_87_lh * 0.8\n# sample_submission.liver_low = sample_submission.liver_low * 0.1 + sub_3_v1_0_87_ll * 0.1 + sub_3_v2_0_87_ll * 0.8\n# sample_submission.liver_high = sample_submission.liver_high * 0.1 + sub_3_v1_0_87_lhi * 0.1 + sub_3_v2_0_87_lhi * 0.8\n\n# sample_submission.spleen_healthy = sample_submission.spleen_healthy * 0.1 + sub_3_v1_0_87_sh * 0.1 + sub_3_v2_0_87_sh * 0.8\n# sample_submission.spleen_low = sample_submission.spleen_low * 0.1 + sub_3_v1_0_87_sl * 0.1 + sub_3_v2_0_87_sl * 0.8\n# sample_submission.spleen_high = sample_submission.spleen_high * 0.1 + sub_3_v1_0_87_shi * 0.1 + sub_3_v2_0_87_shi * 0.8","metadata":{"execution":{"iopub.status.busy":"2023-09-18T18:31:36.992952Z","iopub.execute_input":"2023-09-18T18:31:36.993387Z","iopub.status.idle":"2023-09-18T18:31:37.006132Z","shell.execute_reply.started":"2023-09-18T18:31:36.99335Z","shell.execute_reply":"2023-09-18T18:31:37.005072Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"feats_1 = ['bowel_healthy', 'extravasation_healthy', 'kidney_healthy', 'liver_healthy', 'spleen_healthy']\nfeats_2 = ['bowel_injury', 'extravasation_injury', 'kidney_high', 'liver_low', 'liver_high', 'spleen_high']\n\nfor feature in features:\n    \n    if feature in feats_1:\n        sample_submission[feature] *= 10\n    elif feature in feats_2:\n        sample_submission[feature] *= 20","metadata":{"execution":{"iopub.status.busy":"2023-09-18T18:31:37.007145Z","iopub.execute_input":"2023-09-18T18:31:37.00795Z","iopub.status.idle":"2023-09-18T18:31:37.028276Z","shell.execute_reply.started":"2023-09-18T18:31:37.007918Z","shell.execute_reply":"2023-09-18T18:31:37.027207Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"sample_submission","metadata":{"execution":{"iopub.status.busy":"2023-09-18T18:31:37.029366Z","iopub.execute_input":"2023-09-18T18:31:37.02995Z","iopub.status.idle":"2023-09-18T18:31:37.050864Z","shell.execute_reply.started":"2023-09-18T18:31:37.029919Z","shell.execute_reply":"2023-09-18T18:31:37.049486Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"sample_submission.to_csv('submission.csv', index=False)","metadata":{"execution":{"iopub.status.busy":"2023-09-18T18:31:37.052533Z","iopub.execute_input":"2023-09-18T18:31:37.053002Z","iopub.status.idle":"2023-09-18T18:31:37.065868Z","shell.execute_reply.started":"2023-09-18T18:31:37.052969Z","shell.execute_reply":"2023-09-18T18:31:37.065173Z"},"trusted":true},"execution_count":null,"outputs":[]}]}