{"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 joblib","metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","execution":{"iopub.status.busy":"2022-10-07T10:52:07.541585Z","iopub.execute_input":"2022-10-07T10:52:07.542644Z","iopub.status.idle":"2022-10-07T10:52:07.654720Z","shell.execute_reply.started":"2022-10-07T10:52:07.542546Z","shell.execute_reply":"2022-10-07T10:52:07.653486Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"sub = pd.read_csv('../input/tabular-playground-series-oct-2022/sample_submission.csv')\n\nFEATURES = ['ball_pos_x', 'ball_pos_y', 'ball_pos_z', 'ball_vel_x', 'ball_vel_y',\n       'ball_vel_z', 'p0_pos_x', 'p0_pos_y', 'p0_pos_z', 'p0_vel_x',\n       'p0_vel_y', 'p0_vel_z', 'p0_boost', 'p1_pos_x', 'p1_pos_y', 'p1_pos_z',\n       'p1_vel_x', 'p1_vel_y', 'p1_vel_z', 'p1_boost', 'p2_pos_x', 'p2_pos_y',\n       'p2_pos_z', 'p2_vel_x', 'p2_vel_y', 'p2_vel_z', 'p2_boost', 'p3_pos_x',\n       'p3_pos_y', 'p3_pos_z', 'p3_vel_x', 'p3_vel_y', 'p3_vel_z', 'p3_boost',\n       'p4_pos_x', 'p4_pos_y', 'p4_pos_z', 'p4_vel_x', 'p4_vel_y', 'p4_vel_z',\n       'p4_boost', 'p5_pos_x', 'p5_pos_y', 'p5_pos_z', 'p5_vel_x', 'p5_vel_y',\n       'p5_vel_z', 'p5_boost', 'boost0_timer', 'boost1_timer', 'boost2_timer',\n       'boost3_timer', 'boost4_timer', 'boost5_timer']\n\ntest = pd.read_csv('../input/tabular-playground-series-oct-2022/test.csv')\ntest = test[FEATURES]","metadata":{"execution":{"iopub.status.busy":"2022-10-07T10:52:09.202508Z","iopub.execute_input":"2022-10-07T10:52:09.203006Z","iopub.status.idle":"2022-10-07T10:52:21.451536Z","shell.execute_reply.started":"2022-10-07T10:52:09.202959Z","shell.execute_reply":"2022-10-07T10:52:21.449929Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"predictions = []\nfor fold in range(10):\n    model = joblib.load('../input/tps-oct-2022-catb-catb/aa/A/model_'+str(fold)+'.pkl')\n    predictions.append([i[1] for i in model.predict_proba(test)])\npredictions = np.average(np.array(predictions),axis=0)\nsub['team_A_scoring_within_10sec'] = predictions\n\npredictions = []\nfor fold in range(10):\n    model = joblib.load('../input/tps-oct-2022-catb-catb/aa/B/model_'+str(fold)+'.pkl')\n    predictions.append([i[1] for i in model.predict_proba(test)])\npredictions = np.average(np.array(predictions),axis=0)\nsub['team_B_scoring_within_10sec'] = predictions\n\nsub.to_csv('submission.csv',index = False)\nsub.head()","metadata":{"execution":{"iopub.status.busy":"2022-10-06T15:09:38.177953Z","iopub.execute_input":"2022-10-06T15:09:38.179243Z","iopub.status.idle":"2022-10-06T15:11:17.642800Z","shell.execute_reply.started":"2022-10-06T15:09:38.179163Z","shell.execute_reply":"2022-10-06T15:11:17.641763Z"},"trusted":true},"execution_count":null,"outputs":[]}]}