{"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":"Thanks to The Devastator, Martin Kovacevic Buvinic, and Mukesh Bhandarkar for their amazing notebooks!\nNote: This is mean ensembling with 4 different notebooks.","metadata":{}},{"cell_type":"code","source":"ensemble_weights = [0.3749,0.3751,0.21,0.04] # sub1, sub2, sub3, sub4","metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","execution":{"iopub.status.busy":"2022-08-21T09:29:59.030641Z","iopub.execute_input":"2022-08-21T09:29:59.031048Z","iopub.status.idle":"2022-08-21T09:29:59.036067Z","shell.execute_reply.started":"2022-08-21T09:29:59.031016Z","shell.execute_reply":"2022-08-21T09:29:59.035064Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"import numpy as np\nimport pandas as pd\nimport matplotlib.pyplot as plt\nimport seaborn as sns\n\nsub = pd.read_csv('../input/amex-default-prediction/sample_submission.csv')\nsub.loc[sub['prediction'] == 0, 'prediction'] = 0.1","metadata":{"execution":{"iopub.status.busy":"2022-08-21T09:29:59.037896Z","iopub.execute_input":"2022-08-21T09:29:59.038513Z","iopub.status.idle":"2022-08-21T09:30:00.158034Z","shell.execute_reply.started":"2022-08-21T09:29:59.038479Z","shell.execute_reply":"2022-08-21T09:30:00.156876Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"sub1 = pd.read_csv('../input/lag-features-are-all-you-need/submission.csv')\nplt.figure(figsize=(8,6), dpi=100)\nsns.histplot(data=sub1, x='prediction', color='r')\nplt.show()","metadata":{"execution":{"iopub.status.busy":"2022-08-21T09:30:00.159559Z","iopub.execute_input":"2022-08-21T09:30:00.159929Z","iopub.status.idle":"2022-08-21T09:30:01.854515Z","shell.execute_reply.started":"2022-08-21T09:30:00.159897Z","shell.execute_reply":"2022-08-21T09:30:01.853445Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"sub2 = pd.read_csv('../input/amex-lgbm-dart-cv-0-7977/test_lgbm_baseline_5fold_seed_blend.csv')\nplt.figure(figsize=(8,6), dpi=100)\nsns.histplot(data=sub2, x='prediction', color='orange')\nplt.show()","metadata":{"execution":{"iopub.status.busy":"2022-08-21T09:30:01.856013Z","iopub.execute_input":"2022-08-21T09:30:01.857077Z","iopub.status.idle":"2022-08-21T09:30:03.663690Z","shell.execute_reply.started":"2022-08-21T09:30:01.857034Z","shell.execute_reply":"2022-08-21T09:30:03.662541Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"sub3 = pd.read_csv('../input/the-fine-art-of-hyperparameter-tuning/submission.csv')\nplt.figure(figsize=(8,6), dpi=100)\nsns.histplot(data=sub3, x='prediction', color='g')\nplt.show()","metadata":{"execution":{"iopub.status.busy":"2022-08-21T09:30:03.667074Z","iopub.execute_input":"2022-08-21T09:30:03.667989Z","iopub.status.idle":"2022-08-21T09:30:05.318321Z","shell.execute_reply.started":"2022-08-21T09:30:03.667951Z","shell.execute_reply":"2022-08-21T09:30:05.317202Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"sub4 = pd.read_csv('../input/amex-lgbm-dart-cv-0-7963-improved/submission.csv')\nplt.figure(figsize=(8,6), dpi=100)\nsns.histplot(data=sub4, x='prediction', color='cyan')\nplt.show()","metadata":{"execution":{"iopub.status.busy":"2022-08-21T09:30:05.319705Z","iopub.execute_input":"2022-08-21T09:30:05.320065Z","iopub.status.idle":"2022-08-21T09:30:06.984698Z","shell.execute_reply.started":"2022-08-21T09:30:05.320033Z","shell.execute_reply":"2022-08-21T09:30:06.983457Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"sub['prediction'] = ensemble_weights[0]*sub1['prediction'] + ensemble_weights[1]*sub2['prediction'] + ensemble_weights[2]*sub3['prediction'] + ensemble_weights[3]*sub4['prediction']\nplt.figure(figsize=(8,6), dpi=100)\nsns.histplot(data=sub, x='prediction', color='b')\nplt.show()","metadata":{"execution":{"iopub.status.busy":"2022-08-21T09:30:06.986458Z","iopub.execute_input":"2022-08-21T09:30:06.988728Z","iopub.status.idle":"2022-08-21T09:30:07.471424Z","shell.execute_reply.started":"2022-08-21T09:30:06.988689Z","shell.execute_reply":"2022-08-21T09:30:07.470130Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"sub.to_csv('submission.csv', index=False)","metadata":{"execution":{"iopub.status.busy":"2022-08-21T09:30:07.472975Z","iopub.execute_input":"2022-08-21T09:30:07.476747Z","iopub.status.idle":"2022-08-21T09:30:10.682943Z","shell.execute_reply.started":"2022-08-21T09:30:07.476708Z","shell.execute_reply":"2022-08-21T09:30:10.681976Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"sub.head()","metadata":{"execution":{"iopub.status.busy":"2022-08-21T09:30:22.250631Z","iopub.execute_input":"2022-08-21T09:30:22.250977Z","iopub.status.idle":"2022-08-21T09:30:22.265283Z","shell.execute_reply.started":"2022-08-21T09:30:22.250947Z","shell.execute_reply":"2022-08-21T09:30:22.264479Z"},"trusted":true},"execution_count":null,"outputs":[]}]}