{"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":"# This Python 3 environment comes with many helpful analytics libraries installed\n# It is defined by the kaggle/python Docker image: https://github.com/kaggle/docker-python\n# For example, here's several helpful packages to load\n\nimport numpy as np # linear algebra\nimport pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)\n\n# Input data files are available in the read-only \"../input/\" directory\n# For example, running this (by clicking run or pressing Shift+Enter) will list all files under the input directory\n\nimport os\nfor dirname, _, filenames in os.walk('/kaggle/input'):\n    for filename in filenames:\n        print(os.path.join(dirname, filename))\n\n# You can write up to 20GB to the current directory (/kaggle/working/) that gets preserved as output when you create a version using \"Save & Run All\" \n# You can also write temporary files to /kaggle/temp/, but they won't be saved outside of the current session","metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","execution":{"iopub.status.busy":"2022-10-27T16:48:28.168849Z","iopub.execute_input":"2022-10-27T16:48:28.169896Z","iopub.status.idle":"2022-10-27T16:48:28.179329Z","shell.execute_reply.started":"2022-10-27T16:48:28.169842Z","shell.execute_reply":"2022-10-27T16:48:28.177968Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"from sklearn.preprocessing import OneHotEncoder\nfrom sklearn.preprocessing import LabelEncoder\nfrom sklearn.feature_selection import SelectKBest\nfrom sklearn.feature_selection import chi2\nfrom sklearn import preprocessing\nfrom sklearn import datasets\nfrom sklearn import metrics\nfrom sklearn.ensemble import ExtraTreesClassifier\nfrom sklearn.datasets import make_regression\nfrom sklearn.model_selection import train_test_split\nfrom sklearn.feature_selection import SelectKBest\nfrom sklearn.feature_selection import mutual_info_regression\nfrom sklearn.feature_selection import f_regression\nfrom matplotlib import pyplot\nimport tensorflow\ntensorflow.random.set_seed(1)\nfrom tensorflow.python.keras.layers import Dense\nfrom tensorflow.keras.layers import Dropout\nfrom tensorflow.python.keras.models import Sequential\nfrom keras.callbacks import EarlyStopping, ModelCheckpoint, ReduceLROnPlateau\nimport xgboost as xg \nfrom sklearn.model_selection import train_test_split \nfrom sklearn.metrics import mean_squared_error as MSE \nfrom catboost import CatBoostRegressor\nfrom xgboost import XGBClassifier","metadata":{"execution":{"iopub.status.busy":"2022-10-27T16:48:29.630557Z","iopub.execute_input":"2022-10-27T16:48:29.631092Z","iopub.status.idle":"2022-10-27T16:48:37.742919Z","shell.execute_reply.started":"2022-10-27T16:48:29.631053Z","shell.execute_reply":"2022-10-27T16:48:37.741683Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"subm = pd.read_csv('/kaggle/input/tabular-playground-series-oct-2022/sample_submission.csv')\nsubm ","metadata":{"execution":{"iopub.status.busy":"2022-10-27T16:48:37.745334Z","iopub.execute_input":"2022-10-27T16:48:37.746148Z","iopub.status.idle":"2022-10-27T16:48:38.023346Z","shell.execute_reply.started":"2022-10-27T16:48:37.746103Z","shell.execute_reply":"2022-10-27T16:48:38.022036Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df_train_columns = pd.read_csv('/kaggle/input/tabular-playground-series-oct-2022/train_dtypes.csv')\ndf_test_columns = pd.read_csv('/kaggle/input/tabular-playground-series-oct-2022/test_dtypes.csv')","metadata":{"execution":{"iopub.status.busy":"2022-10-27T16:48:38.024991Z","iopub.execute_input":"2022-10-27T16:48:38.026110Z","iopub.status.idle":"2022-10-27T16:48:38.044679Z","shell.execute_reply.started":"2022-10-27T16:48:38.026064Z","shell.execute_reply":"2022-10-27T16:48:38.043504Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"#df_train_columns['column'].compare(df_test_columns['column'])\nmissing_columns = pd.concat([df_train_columns['column'],df_test_columns['column']]).drop_duplicates(keep=False).values","metadata":{"execution":{"iopub.status.busy":"2022-10-27T16:48:38.048351Z","iopub.execute_input":"2022-10-27T16:48:38.048873Z","iopub.status.idle":"2022-10-27T16:48:38.061148Z","shell.execute_reply.started":"2022-10-27T16:48:38.048826Z","shell.execute_reply":"2022-10-27T16:48:38.059819Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"for i in df_test_columns['column']:\n    if i in missing_columns:\n        print(i ,\" -- not present in train data \")","metadata":{"execution":{"iopub.status.busy":"2022-10-27T16:48:38.062762Z","iopub.execute_input":"2022-10-27T16:48:38.063519Z","iopub.status.idle":"2022-10-27T16:48:38.073979Z","shell.execute_reply.started":"2022-10-27T16:48:38.063482Z","shell.execute_reply":"2022-10-27T16:48:38.072721Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"for i in df_train_columns['column']:\n    if i in missing_columns:\n        print(i ,\" -- not present in test data \")","metadata":{"execution":{"iopub.status.busy":"2022-10-27T16:48:38.075520Z","iopub.execute_input":"2022-10-27T16:48:38.076606Z","iopub.status.idle":"2022-10-27T16:48:38.087686Z","shell.execute_reply.started":"2022-10-27T16:48:38.076571Z","shell.execute_reply":"2022-10-27T16:48:38.086316Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df = pd.read_csv(r\"/kaggle/input/tabular-playground-series-oct-2022/train_{}.csv\".format(1))\nfor i in range(2,8):\n    temp_df = pd.read_csv(r\"/kaggle/input/tabular-playground-series-oct-2022/train_{}.csv\".format(i))\n    df =pd.concat([df,temp_df])","metadata":{"execution":{"iopub.status.busy":"2022-10-27T16:48:38.089465Z","iopub.execute_input":"2022-10-27T16:48:38.089959Z","iopub.status.idle":"2022-10-27T16:53:16.950117Z","shell.execute_reply.started":"2022-10-27T16:48:38.089895Z","shell.execute_reply":"2022-10-27T16:53:16.947693Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df.columns","metadata":{"execution":{"iopub.status.busy":"2022-10-27T16:53:16.952990Z","iopub.execute_input":"2022-10-27T16:53:16.953625Z","iopub.status.idle":"2022-10-27T16:53:16.965957Z","shell.execute_reply.started":"2022-10-27T16:53:16.953580Z","shell.execute_reply":"2022-10-27T16:53:16.964608Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"#df.to_csv('train.csv')","metadata":{"execution":{"iopub.status.busy":"2022-10-27T16:53:16.970707Z","iopub.execute_input":"2022-10-27T16:53:16.971116Z","iopub.status.idle":"2022-10-27T16:53:16.979558Z","shell.execute_reply.started":"2022-10-27T16:53:16.971081Z","shell.execute_reply":"2022-10-27T16:53:16.978674Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"#df.describe()","metadata":{"execution":{"iopub.status.busy":"2022-10-27T16:53:16.980836Z","iopub.execute_input":"2022-10-27T16:53:16.982310Z","iopub.status.idle":"2022-10-27T16:53:16.994690Z","shell.execute_reply.started":"2022-10-27T16:53:16.982201Z","shell.execute_reply":"2022-10-27T16:53:16.993462Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df.head()","metadata":{"execution":{"iopub.status.busy":"2022-10-27T16:53:16.996166Z","iopub.execute_input":"2022-10-27T16:53:16.996512Z","iopub.status.idle":"2022-10-27T16:53:17.039139Z","shell.execute_reply.started":"2022-10-27T16:53:16.996484Z","shell.execute_reply":"2022-10-27T16:53:17.037866Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df.info()","metadata":{"execution":{"iopub.status.busy":"2022-10-27T16:53:17.041283Z","iopub.execute_input":"2022-10-27T16:53:17.042158Z","iopub.status.idle":"2022-10-27T16:53:17.071755Z","shell.execute_reply.started":"2022-10-27T16:53:17.042113Z","shell.execute_reply":"2022-10-27T16:53:17.070184Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df['player_scoring_next'].unique()\ndf['team_scoring_next'].unique()\n","metadata":{"execution":{"iopub.status.busy":"2022-10-27T16:53:17.073429Z","iopub.execute_input":"2022-10-27T16:53:17.073846Z","iopub.status.idle":"2022-10-27T16:53:17.677486Z","shell.execute_reply.started":"2022-10-27T16:53:17.073800Z","shell.execute_reply":"2022-10-27T16:53:17.676131Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df ['team_A_scoring_within_10sec'].unique()","metadata":{"execution":{"iopub.status.busy":"2022-10-27T16:53:17.679134Z","iopub.execute_input":"2022-10-27T16:53:17.679472Z","iopub.status.idle":"2022-10-27T16:53:17.770884Z","shell.execute_reply.started":"2022-10-27T16:53:17.679443Z","shell.execute_reply":"2022-10-27T16:53:17.769312Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df[df['team_A_scoring_within_10sec'] ==1] ['team_scoring_next']","metadata":{"execution":{"iopub.status.busy":"2022-10-27T16:53:17.773146Z","iopub.execute_input":"2022-10-27T16:53:17.773538Z","iopub.status.idle":"2022-10-27T16:53:18.536734Z","shell.execute_reply.started":"2022-10-27T16:53:17.773505Z","shell.execute_reply":"2022-10-27T16:53:18.535617Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df.isna().any().values\n","metadata":{"execution":{"iopub.status.busy":"2022-10-27T16:53:18.538140Z","iopub.execute_input":"2022-10-27T16:53:18.538490Z","iopub.status.idle":"2022-10-27T16:53:19.866683Z","shell.execute_reply.started":"2022-10-27T16:53:18.538458Z","shell.execute_reply":"2022-10-27T16:53:19.865691Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"samp = df.isna().any().values\nprint(samp)\nprint(df['team_scoring_next'].isna().any())","metadata":{"execution":{"iopub.status.busy":"2022-10-27T16:53:19.868267Z","iopub.execute_input":"2022-10-27T16:53:19.869779Z","iopub.status.idle":"2022-10-27T16:53:22.223263Z","shell.execute_reply.started":"2022-10-27T16:53:19.869727Z","shell.execute_reply":"2022-10-27T16:53:22.221725Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"\nfor col in df.columns:\n    if df[col].isna().any() == 'True':\n        mean_value = df[col].dropna().mean()\n        df[col].fillna(value = mean_value,inplace = True)\n","metadata":{"execution":{"iopub.status.busy":"2022-10-27T16:53:22.225801Z","iopub.execute_input":"2022-10-27T16:53:22.226962Z","iopub.status.idle":"2022-10-27T16:53:23.975237Z","shell.execute_reply.started":"2022-10-27T16:53:22.226908Z","shell.execute_reply":"2022-10-27T16:53:23.974002Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df.dropna(inplace=True)","metadata":{"execution":{"iopub.status.busy":"2022-10-27T16:53:23.976969Z","iopub.execute_input":"2022-10-27T16:53:23.977422Z","iopub.status.idle":"2022-10-27T16:53:31.059694Z","shell.execute_reply.started":"2022-10-27T16:53:23.977378Z","shell.execute_reply":"2022-10-27T16:53:31.058354Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"\"\"\" output columns  - team_A_scoring_within_10sec, team_B_scoring_within_10sec \"\"\"","metadata":{"execution":{"iopub.status.busy":"2022-10-27T16:53:31.064260Z","iopub.execute_input":"2022-10-27T16:53:31.064663Z","iopub.status.idle":"2022-10-27T16:53:31.073102Z","shell.execute_reply.started":"2022-10-27T16:53:31.064630Z","shell.execute_reply":"2022-10-27T16:53:31.071773Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"\"\"\"scaling\"\"\"\nnames = df.drop(['team_scoring_next','player_scoring_next','event_id','event_time','game_num','team_A_scoring_within_10sec', 'team_B_scoring_within_10sec'],axis =1).columns\nscaler = preprocessing.MinMaxScaler((0,1))\nscaled_df = scaler.fit_transform(df.drop(['team_scoring_next','player_scoring_next',\n                                          'event_id','event_time',\n                                          'game_num','team_A_scoring_within_10sec', \n                                          'team_B_scoring_within_10sec'],axis =1))\nscaled_df = pd.DataFrame(scaled_df, columns=names)\n\n\n","metadata":{"execution":{"iopub.status.busy":"2022-10-27T16:53:31.074781Z","iopub.execute_input":"2022-10-27T16:53:31.076190Z","iopub.status.idle":"2022-10-27T16:53:42.485640Z","shell.execute_reply.started":"2022-10-27T16:53:31.076132Z","shell.execute_reply":"2022-10-27T16:53:42.484236Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"#X = df.drop(['team_scoring_next','event_id','event_time','game_num','team_A_scoring_within_10sec', 'team_B_scoring_within_10sec'],axis =1).values\nX = scaled_df.values\n#X = df.drop(['team_scoring_next','player_scoring_next',\n#                                          'event_id','event_time',\n#                                          'game_num','team_A_scoring_within_10sec', \n#                                          'team_B_scoring_within_10sec'],axis = 1).values","metadata":{"execution":{"iopub.status.busy":"2022-10-27T16:53:42.487259Z","iopub.execute_input":"2022-10-27T16:53:42.487595Z","iopub.status.idle":"2022-10-27T16:53:42.493160Z","shell.execute_reply.started":"2022-10-27T16:53:42.487567Z","shell.execute_reply":"2022-10-27T16:53:42.491977Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"y_A = df['team_A_scoring_within_10sec'].values\ny_B = df['team_B_scoring_within_10sec'].values","metadata":{"execution":{"iopub.status.busy":"2022-10-27T16:53:42.494808Z","iopub.execute_input":"2022-10-27T16:53:42.495161Z","iopub.status.idle":"2022-10-27T16:53:42.510003Z","shell.execute_reply.started":"2022-10-27T16:53:42.495130Z","shell.execute_reply":"2022-10-27T16:53:42.508623Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df_test = pd.read_csv(r'/kaggle/input/tabular-playground-series-oct-2022/test.csv')\ndf_test.fillna(value = 0 , inplace=True)\nscaled_test_df = scaler.transform(df_test.drop(['id'],axis=1))\n#X_test = df_test.drop(['id'],axis=1).values\nX_test = scaled_test_df\n#X_test = df_test.drop(['id'],axis=1).values","metadata":{"execution":{"iopub.status.busy":"2022-10-27T16:53:42.511611Z","iopub.execute_input":"2022-10-27T16:53:42.513131Z","iopub.status.idle":"2022-10-27T16:53:54.441205Z","shell.execute_reply.started":"2022-10-27T16:53:42.513090Z","shell.execute_reply":"2022-10-27T16:53:54.440005Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"negative_columns=np.any(X,axis=0)\nprint(negative_columns,negative_columns.shape)\n","metadata":{"execution":{"iopub.status.busy":"2022-10-27T16:53:54.442568Z","iopub.execute_input":"2022-10-27T16:53:54.442917Z","iopub.status.idle":"2022-10-27T16:53:55.175087Z","shell.execute_reply.started":"2022-10-27T16:53:54.442884Z","shell.execute_reply":"2022-10-27T16:53:55.173988Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"def select_features(X_train, y_train, X_test):\n    # configure to select all features\n    fs = SelectKBest(score_func=chi2, k=40)\n    # learn relationship from training data\n    fs.fit(X_train, y_train)\n    # transform train input data\n    X_train_fs = fs.transform(X_train)\n    # transform test input data\n    X_test_fs = fs.transform(X_test)\n\n    return X_train_fs, X_test_fs, fs","metadata":{"execution":{"iopub.status.busy":"2022-10-27T16:53:55.176652Z","iopub.execute_input":"2022-10-27T16:53:55.177179Z","iopub.status.idle":"2022-10-27T16:53:55.183798Z","shell.execute_reply.started":"2022-10-27T16:53:55.177144Z","shell.execute_reply":"2022-10-27T16:53:55.182981Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"network={}\nfor i in range(2):\n    \"\"\"stacking 20 best input features for team A and team B\"\"\"\n    y= None\n    if i ==0 :\n        y = y_A\n        idf = 'A'\n    elif i == 1 :\n        y = y_B\n        idf = 'B'\n    X_train_fs, X_test_fs, fs = select_features(X, y, X_test)\n    network[idf] = {'X_train':X_train_fs,'X_test':X_test_fs,'y' :y}\n    print (\" ===========Network \",i,\" ===========\")\n    for i in range(len(fs.scores_)):\n        print('Feature %d: %f' % (i, fs.scores_[i]))\n\n    pyplot.bar([i for i in range(len(fs.scores_))], fs.scores_)\n    pyplot.show()","metadata":{"execution":{"iopub.status.busy":"2022-10-27T16:53:55.185017Z","iopub.execute_input":"2022-10-27T16:53:55.185867Z","iopub.status.idle":"2022-10-27T16:54:13.279635Z","shell.execute_reply.started":"2022-10-27T16:53:55.185825Z","shell.execute_reply":"2022-10-27T16:54:13.278144Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"network['B']","metadata":{"execution":{"iopub.status.busy":"2022-10-27T16:54:13.281440Z","iopub.execute_input":"2022-10-27T16:54:13.282383Z","iopub.status.idle":"2022-10-27T16:54:13.290720Z","shell.execute_reply.started":"2022-10-27T16:54:13.282345Z","shell.execute_reply":"2022-10-27T16:54:13.289873Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"Stacking the Catboost classifiers \n","metadata":{}},{"cell_type":"code","source":"catboost_clf = {}","metadata":{"execution":{"iopub.status.busy":"2022-10-27T16:54:13.292288Z","iopub.execute_input":"2022-10-27T16:54:13.292733Z","iopub.status.idle":"2022-10-27T16:54:13.315448Z","shell.execute_reply.started":"2022-10-27T16:54:13.292697Z","shell.execute_reply":"2022-10-27T16:54:13.314331Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"len(network)","metadata":{"execution":{"iopub.status.busy":"2022-10-27T16:54:13.317456Z","iopub.execute_input":"2022-10-27T16:54:13.318232Z","iopub.status.idle":"2022-10-27T16:54:13.331549Z","shell.execute_reply.started":"2022-10-27T16:54:13.318193Z","shell.execute_reply":"2022-10-27T16:54:13.330255Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"from catboost import CatBoostClassifier\ncat_features=[ 0,1]\nfor key,val in network.items():\n    print( \"===== Network {} =====\".format(key))\n    clf = CatBoostClassifier(iterations=100,random_seed=42,learning_rate=0.5 )\n                         #,custom_loss=['AUC', 'Accuracy'])\n\n    clf.fit(val['X_train'], val['y'])\n    catboost_clf[key] = clf","metadata":{"execution":{"iopub.status.busy":"2022-10-27T16:54:13.333572Z","iopub.execute_input":"2022-10-27T16:54:13.334401Z","iopub.status.idle":"2022-10-27T17:02:16.706951Z","shell.execute_reply.started":"2022-10-27T16:54:13.334362Z","shell.execute_reply":"2022-10-27T17:02:16.705084Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"raw","source":"","metadata":{"execution":{"iopub.status.busy":"2022-10-24T14:36:01.951358Z","iopub.execute_input":"2022-10-24T14:36:01.951754Z","iopub.status.idle":"2022-10-24T14:36:04.460388Z","shell.execute_reply.started":"2022-10-24T14:36:01.951721Z","shell.execute_reply":"2022-10-24T14:36:04.458855Z"}}},{"cell_type":"code","source":"y_pred ={}\nfor key,clf in catboost_clf.items():\n    y_pred[key] = clf.predict(network[key]['X_test'])\n","metadata":{"execution":{"iopub.status.busy":"2022-10-27T17:02:16.709131Z","iopub.execute_input":"2022-10-27T17:02:16.709544Z","iopub.status.idle":"2022-10-27T17:02:17.347471Z","shell.execute_reply.started":"2022-10-27T17:02:16.709507Z","shell.execute_reply":"2022-10-27T17:02:17.346113Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"y_pred","metadata":{"execution":{"iopub.status.busy":"2022-10-27T17:02:17.349171Z","iopub.execute_input":"2022-10-27T17:02:17.349516Z","iopub.status.idle":"2022-10-27T17:02:17.357092Z","shell.execute_reply.started":"2022-10-27T17:02:17.349484Z","shell.execute_reply":"2022-10-27T17:02:17.356212Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"id = list(df_test['id'].values)\nteam_A_scoring_within_10sec = list (y_pred['A'])\nteam_B_scoring_within_10sec = list(y_pred['B'])","metadata":{"execution":{"iopub.status.busy":"2022-10-27T17:02:17.358520Z","iopub.execute_input":"2022-10-27T17:02:17.359234Z","iopub.status.idle":"2022-10-27T17:02:17.530470Z","shell.execute_reply.started":"2022-10-27T17:02:17.359194Z","shell.execute_reply":"2022-10-27T17:02:17.529184Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"dict = {'id':id , \n       'team_A_scoring_within_10sec': team_A_scoring_within_10sec,\n       'team_B_scoring_within_10sec' :team_B_scoring_within_10sec }","metadata":{"execution":{"iopub.status.busy":"2022-10-27T17:02:17.532634Z","iopub.execute_input":"2022-10-27T17:02:17.533111Z","iopub.status.idle":"2022-10-27T17:02:17.549972Z","shell.execute_reply.started":"2022-10-27T17:02:17.533056Z","shell.execute_reply":"2022-10-27T17:02:17.548057Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"Output=pd.DataFrame(dict)\nOutput.to_csv('output_CATBOOST.csv',index=False)","metadata":{"execution":{"iopub.status.busy":"2022-10-27T17:02:17.582569Z","iopub.execute_input":"2022-10-27T17:02:17.583153Z","iopub.status.idle":"2022-10-27T17:02:19.234496Z","shell.execute_reply.started":"2022-10-27T17:02:17.583113Z","shell.execute_reply":"2022-10-27T17:02:19.232913Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]}]}