{"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":"code","source":"import numpy as np\nimport pandas as pd\nfrom os.path import join","metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","execution":{"iopub.status.busy":"2022-10-07T03:07:12.107334Z","iopub.execute_input":"2022-10-07T03:07:12.10795Z","iopub.status.idle":"2022-10-07T03:07:12.114063Z","shell.execute_reply.started":"2022-10-07T03:07:12.107893Z","shell.execute_reply":"2022-10-07T03:07:12.112726Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"KAGGLE_DATA = r'../input/rsna-2022-cervical-spine-fracture-detection'\n\ntrain_df = pd.read_csv(join(KAGGLE_DATA, \"train.csv\"))\ntrain_img_path = join(KAGGLE_DATA, \"train_images\")\ntest_df = pd.read_csv(join(KAGGLE_DATA, \"test.csv\"))\ntest_img_path = join(KAGGLE_DATA, \"test_images\")\n\nprint('train shape:', train_df.shape)\nprint('test shape:', test_df.shape)","metadata":{"execution":{"iopub.status.busy":"2022-10-07T03:07:12.117027Z","iopub.execute_input":"2022-10-07T03:07:12.117537Z","iopub.status.idle":"2022-10-07T03:07:12.139714Z","shell.execute_reply.started":"2022-10-07T03:07:12.117482Z","shell.execute_reply":"2022-10-07T03:07:12.138168Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"def scale_up(q):\n    return 2*q/(1+q)","metadata":{"execution":{"iopub.status.busy":"2022-10-07T03:07:12.141175Z","iopub.execute_input":"2022-10-07T03:07:12.142548Z","iopub.status.idle":"2022-10-07T03:07:12.148451Z","shell.execute_reply.started":"2022-10-07T03:07:12.142501Z","shell.execute_reply":"2022-10-07T03:07:12.146824Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"sub_df = pd.DataFrame(columns=['row_id', 'fractured'])\nsub_df['row_id'] = test_df['row_id']\nsub_df['fractured'] = test_df['prediction_type'].map(\n    train_df.mean(numeric_only=True).map(scale_up).to_dict()\n)\nsub_df.to_csv('submission.csv', index=False)","metadata":{"execution":{"iopub.status.busy":"2022-10-07T03:07:12.150118Z","iopub.execute_input":"2022-10-07T03:07:12.150824Z","iopub.status.idle":"2022-10-07T03:07:12.167847Z","shell.execute_reply.started":"2022-10-07T03:07:12.150785Z","shell.execute_reply":"2022-10-07T03:07:12.16668Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]}]}