{"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 pandas as pd\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport seaborn as sns\nseaborn_prms = {\n    \"context\": 'notebook',\n    \"style\": 'whitegrid',\n    \"rc\" : {\n        'grid.linestyle': \"--\"\n    }\n}\nsns.set(**seaborn_prms)\n\nimport torch ","metadata":{"execution":{"iopub.status.busy":"2021-09-26T02:22:39.043069Z","iopub.execute_input":"2021-09-26T02:22:39.043434Z","iopub.status.idle":"2021-09-26T02:22:40.836170Z","shell.execute_reply.started":"2021-09-26T02:22:39.043344Z","shell.execute_reply":"2021-09-26T02:22:40.835475Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"!ls /kaggle/input","metadata":{"execution":{"iopub.status.busy":"2021-09-26T01:10:00.057417Z","iopub.execute_input":"2021-09-26T01:10:00.058042Z","iopub.status.idle":"2021-09-26T01:10:00.820931Z","shell.execute_reply.started":"2021-09-26T01:10:00.057999Z","shell.execute_reply":"2021-09-26T01:10:00.819768Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df_1dcnn_submit = pd.read_csv(\"/kaggle/input/g2net-1d-cnn-gem-pool-pytorch-train-inference/1dcnn_folds_1_3.csv\")","metadata":{"execution":{"iopub.status.busy":"2021-09-26T02:59:57.351587Z","iopub.execute_input":"2021-09-26T02:59:57.352422Z","iopub.status.idle":"2021-09-26T02:59:57.553795Z","shell.execute_reply.started":"2021-09-26T02:59:57.352376Z","shell.execute_reply":"2021-09-26T02:59:57.552784Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df_1dcnn_submit","metadata":{"execution":{"iopub.status.busy":"2021-09-26T02:59:57.555177Z","iopub.execute_input":"2021-09-26T02:59:57.555582Z","iopub.status.idle":"2021-09-26T02:59:57.566965Z","shell.execute_reply.started":"2021-09-26T02:59:57.555551Z","shell.execute_reply":"2021-09-26T02:59:57.566350Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df_efnet_submit = pd.read_csv(\"../input/efficientnet-cqt-pytorch-lightning-starter/submission.csv\")","metadata":{"execution":{"iopub.status.busy":"2021-09-26T02:59:57.684082Z","iopub.execute_input":"2021-09-26T02:59:57.684680Z","iopub.status.idle":"2021-09-26T02:59:57.880424Z","shell.execute_reply.started":"2021-09-26T02:59:57.684643Z","shell.execute_reply":"2021-09-26T02:59:57.879741Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df_efnet_submit","metadata":{"execution":{"iopub.status.busy":"2021-09-26T02:59:57.881622Z","iopub.execute_input":"2021-09-26T02:59:57.882077Z","iopub.status.idle":"2021-09-26T02:59:57.895424Z","shell.execute_reply.started":"2021-09-26T02:59:57.882046Z","shell.execute_reply":"2021-09-26T02:59:57.894592Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"def sigmoid(x):\n    return 1/(1+np.exp(-x))","metadata":{"execution":{"iopub.status.busy":"2021-09-26T02:59:58.631160Z","iopub.execute_input":"2021-09-26T02:59:58.631434Z","iopub.status.idle":"2021-09-26T02:59:58.638257Z","shell.execute_reply.started":"2021-09-26T02:59:58.631406Z","shell.execute_reply":"2021-09-26T02:59:58.637453Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df_efnet_submit[\"prob\"] = df_efnet_submit[\"target\"].apply(sigmoid)","metadata":{"execution":{"iopub.status.busy":"2021-09-26T02:59:58.969262Z","iopub.execute_input":"2021-09-26T02:59:58.969699Z","iopub.status.idle":"2021-09-26T02:59:59.400856Z","shell.execute_reply.started":"2021-09-26T02:59:58.969669Z","shell.execute_reply":"2021-09-26T02:59:59.400239Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df_efnet_submit","metadata":{"execution":{"iopub.status.busy":"2021-09-26T02:59:59.402039Z","iopub.execute_input":"2021-09-26T02:59:59.402412Z","iopub.status.idle":"2021-09-26T02:59:59.415063Z","shell.execute_reply.started":"2021-09-26T02:59:59.402384Z","shell.execute_reply":"2021-09-26T02:59:59.414279Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"plt.figure(figsize=(12, 12))\nsns.scatterplot(\n    x=df_1dcnn_submit['target'], \n    y=df_efnet_submit['prob']\n    )\nplt.show()\n","metadata":{"execution":{"iopub.status.busy":"2021-09-26T02:24:25.464482Z","iopub.execute_input":"2021-09-26T02:24:25.464788Z","iopub.status.idle":"2021-09-26T02:24:26.286053Z","shell.execute_reply.started":"2021-09-26T02:24:25.464763Z","shell.execute_reply":"2021-09-26T02:24:26.285410Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"np.corrcoef(df_1dcnn_submit['target'], df_efnet_submit['prob'])","metadata":{"execution":{"iopub.status.busy":"2021-09-26T02:24:26.287503Z","iopub.execute_input":"2021-09-26T02:24:26.287807Z","iopub.status.idle":"2021-09-26T02:24:26.296756Z","shell.execute_reply.started":"2021-09-26T02:24:26.287784Z","shell.execute_reply":"2021-09-26T02:24:26.296227Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"→強い正の相関","metadata":{}},{"cell_type":"code","source":"df_eda = pd.read_csv(\"../input/g2net-eda-and-modeling/model_submission.csv\")","metadata":{"execution":{"iopub.status.busy":"2021-09-26T03:00:05.192467Z","iopub.execute_input":"2021-09-26T03:00:05.192784Z","iopub.status.idle":"2021-09-26T03:00:05.412104Z","shell.execute_reply.started":"2021-09-26T03:00:05.192752Z","shell.execute_reply":"2021-09-26T03:00:05.411363Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df_efnet_submit[\"model3\"] = df_eda[\"target\"]","metadata":{"execution":{"iopub.status.busy":"2021-09-26T03:00:05.413615Z","iopub.execute_input":"2021-09-26T03:00:05.413835Z","iopub.status.idle":"2021-09-26T03:00:05.419359Z","shell.execute_reply.started":"2021-09-26T03:00:05.413810Z","shell.execute_reply":"2021-09-26T03:00:05.418301Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df_efnet_submit[\"model2\"] = df_1dcnn_submit['target']","metadata":{"execution":{"iopub.status.busy":"2021-09-26T03:00:05.611084Z","iopub.execute_input":"2021-09-26T03:00:05.611380Z","iopub.status.idle":"2021-09-26T03:00:05.616082Z","shell.execute_reply.started":"2021-09-26T03:00:05.611352Z","shell.execute_reply":"2021-09-26T03:00:05.615309Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df_efnet_submit","metadata":{"execution":{"iopub.status.busy":"2021-09-26T03:00:06.559408Z","iopub.execute_input":"2021-09-26T03:00:06.559995Z","iopub.status.idle":"2021-09-26T03:00:06.578923Z","shell.execute_reply.started":"2021-09-26T03:00:06.559952Z","shell.execute_reply":"2021-09-26T03:00:06.578089Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df_ike_1 = pd.read_csv(\"../input/ikesubmission/submission_v13_mod3.csv\")\ndf_ike_2 = pd.read_csv(\"../input/ike-submission/submission_v14.csv\")","metadata":{"execution":{"iopub.status.busy":"2021-09-26T03:00:10.277877Z","iopub.execute_input":"2021-09-26T03:00:10.278695Z","iopub.status.idle":"2021-09-26T03:00:10.696870Z","shell.execute_reply.started":"2021-09-26T03:00:10.278656Z","shell.execute_reply":"2021-09-26T03:00:10.694762Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df_ike_1","metadata":{"execution":{"iopub.status.busy":"2021-09-26T03:00:10.698372Z","iopub.execute_input":"2021-09-26T03:00:10.699109Z","iopub.status.idle":"2021-09-26T03:00:10.710303Z","shell.execute_reply.started":"2021-09-26T03:00:10.699077Z","shell.execute_reply":"2021-09-26T03:00:10.709339Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df_ike_2","metadata":{"execution":{"iopub.status.busy":"2021-09-26T03:00:13.815948Z","iopub.execute_input":"2021-09-26T03:00:13.816266Z","iopub.status.idle":"2021-09-26T03:00:13.827772Z","shell.execute_reply.started":"2021-09-26T03:00:13.816230Z","shell.execute_reply":"2021-09-26T03:00:13.827231Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df_ensemble = df_efnet_submit[[\"id\", \"prob\", \"model2\", \"model3\"]].copy()\ndf_ensemble.columns = [\"id\", \"model1\", \"model2\", \"model3\"]\ndf_ensemble['ike1'] = df_ike_1[\"target\"].copy()\n# df_ensemble['ike2'] = df_ike_2[\"target\"].copy()","metadata":{"execution":{"iopub.status.busy":"2021-09-26T03:05:18.860191Z","iopub.execute_input":"2021-09-26T03:05:18.860513Z","iopub.status.idle":"2021-09-26T03:05:18.883159Z","shell.execute_reply.started":"2021-09-26T03:05:18.860482Z","shell.execute_reply":"2021-09-26T03:05:18.882375Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df_ensemble","metadata":{"execution":{"iopub.status.busy":"2021-09-26T03:05:19.568681Z","iopub.execute_input":"2021-09-26T03:05:19.568979Z","iopub.status.idle":"2021-09-26T03:05:19.586034Z","shell.execute_reply.started":"2021-09-26T03:05:19.568948Z","shell.execute_reply":"2021-09-26T03:05:19.585087Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df_ike_2","metadata":{"execution":{"iopub.status.busy":"2021-09-26T03:04:59.233590Z","iopub.execute_input":"2021-09-26T03:04:59.233881Z","iopub.status.idle":"2021-09-26T03:04:59.249026Z","shell.execute_reply.started":"2021-09-26T03:04:59.233851Z","shell.execute_reply":"2021-09-26T03:04:59.248195Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df_ensemble_2 = pd.merge(df_ensemble, df_ike_2, how=\"inner\", on=\"id\")","metadata":{"execution":{"iopub.status.busy":"2021-09-26T03:05:27.573113Z","iopub.execute_input":"2021-09-26T03:05:27.573427Z","iopub.status.idle":"2021-09-26T03:05:27.782717Z","shell.execute_reply.started":"2021-09-26T03:05:27.573390Z","shell.execute_reply":"2021-09-26T03:05:27.781932Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df_ensemble_2","metadata":{"execution":{"iopub.status.busy":"2021-09-26T03:05:27.784149Z","iopub.execute_input":"2021-09-26T03:05:27.784435Z","iopub.status.idle":"2021-09-26T03:05:27.800195Z","shell.execute_reply.started":"2021-09-26T03:05:27.784410Z","shell.execute_reply":"2021-09-26T03:05:27.799307Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# simple mean\n\ndf_ensemble_2[\"simple_mean\"] = df_ensemble_2[[\"model1\", \"model2\", \"model3\", \"ike1\", \"target\"]].mean(axis=1).copy()\ndf_ensemble_2","metadata":{"execution":{"iopub.status.busy":"2021-09-26T03:06:22.581552Z","iopub.execute_input":"2021-09-26T03:06:22.581818Z","iopub.status.idle":"2021-09-26T03:06:22.613682Z","shell.execute_reply.started":"2021-09-26T03:06:22.581792Z","shell.execute_reply":"2021-09-26T03:06:22.612800Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"submission_simple_mean = df_ensemble_2[[\"id\", \"simple_mean\"]]\nsubmission_simple_mean.columns = [\"id\", \"target\"]","metadata":{"execution":{"iopub.status.busy":"2021-09-26T03:06:41.855537Z","iopub.execute_input":"2021-09-26T03:06:41.855784Z","iopub.status.idle":"2021-09-26T03:06:41.872099Z","shell.execute_reply.started":"2021-09-26T03:06:41.855760Z","shell.execute_reply":"2021-09-26T03:06:41.871381Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"submission_simple_mean.to_csv('submission_simple_mean.csv', index = False)","metadata":{"execution":{"iopub.status.busy":"2021-09-26T03:06:46.911745Z","iopub.execute_input":"2021-09-26T03:06:46.912002Z","iopub.status.idle":"2021-09-26T03:06:47.462126Z","shell.execute_reply.started":"2021-09-26T03:06:46.911975Z","shell.execute_reply":"2021-09-26T03:06:47.461308Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"→ 0.8613","metadata":{}},{"cell_type":"code","source":"df_ensemble_2[\"simple_mean_3\"] = df_ensemble_2[[\"model2\", \"ike1\", \"target\"]].mean(axis=1).copy()\ndf_ensemble_2","metadata":{"execution":{"iopub.status.busy":"2021-09-26T03:08:51.013229Z","iopub.execute_input":"2021-09-26T03:08:51.014103Z","iopub.status.idle":"2021-09-26T03:08:51.037267Z","shell.execute_reply.started":"2021-09-26T03:08:51.014047Z","shell.execute_reply":"2021-09-26T03:08:51.036439Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"submission_simple_mean_3 = df_ensemble_2[[\"id\", \"simple_mean_3\"]]\nsubmission_simple_mean_3.columns = [\"id\", \"target\"]\nsubmission_simple_mean_3.to_csv('submission_simple_mean_3.csv', index = False)","metadata":{"execution":{"iopub.status.busy":"2021-09-26T03:09:11.688966Z","iopub.execute_input":"2021-09-26T03:09:11.689444Z","iopub.status.idle":"2021-09-26T03:09:12.254680Z","shell.execute_reply.started":"2021-09-26T03:09:11.689401Z","shell.execute_reply":"2021-09-26T03:09:12.253579Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"→ 0.8779","metadata":{}},{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]}]}