{"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":"2023-07-20T07:36:15.727480Z","iopub.execute_input":"2023-07-20T07:36:15.728459Z","iopub.status.idle":"2023-07-20T07:36:15.775025Z","shell.execute_reply.started":"2023-07-20T07:36:15.728422Z","shell.execute_reply":"2023-07-20T07:36:15.773654Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# 1.Load data","metadata":{}},{"cell_type":"code","source":"train = pd.read_csv('/kaggle/input/ext-market/train/train.csv')\ntest = pd.read_csv('/kaggle/input/ext-market/test.csv')","metadata":{"execution":{"iopub.status.busy":"2023-07-20T07:36:15.777173Z","iopub.execute_input":"2023-07-20T07:36:15.778325Z","iopub.status.idle":"2023-07-20T07:37:20.802978Z","shell.execute_reply.started":"2023-07-20T07:36:15.778282Z","shell.execute_reply":"2023-07-20T07:37:20.801791Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"print('Shape train =', train.shape)\nprint('Shape test =', test.shape)","metadata":{"execution":{"iopub.status.busy":"2023-07-20T07:37:20.805009Z","iopub.execute_input":"2023-07-20T07:37:20.805470Z","iopub.status.idle":"2023-07-20T07:37:20.811870Z","shell.execute_reply.started":"2023-07-20T07:37:20.805419Z","shell.execute_reply":"2023-07-20T07:37:20.810691Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# 2.Auto viz","metadata":{}},{"cell_type":"code","source":"'''!pip install AutoViz\n!pip install xlrd'''","metadata":{"execution":{"iopub.status.busy":"2023-07-20T07:37:20.813583Z","iopub.execute_input":"2023-07-20T07:37:20.813996Z","iopub.status.idle":"2023-07-20T07:37:20.833434Z","shell.execute_reply.started":"2023-07-20T07:37:20.813958Z","shell.execute_reply":"2023-07-20T07:37:20.832161Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"'''from autoviz.AutoViz_Class import AutoViz_Class\n\nAV = AutoViz_Class()'''","metadata":{"execution":{"iopub.status.busy":"2023-07-20T07:37:20.836692Z","iopub.execute_input":"2023-07-20T07:37:20.837141Z","iopub.status.idle":"2023-07-20T07:37:20.849060Z","shell.execute_reply.started":"2023-07-20T07:37:20.837080Z","shell.execute_reply":"2023-07-20T07:37:20.847892Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"import matplotlib.pyplot as plt\nimport seaborn as sns\nimport matplotlib as mpl\nmpl.rcParams.update(mpl.rcParamsDefault)\nimport warnings\nwarnings.filterwarnings('ignore')\nfrom IPython.display import Image\n%matplotlib inline\n\n#dftc = AV.AutoViz('/kaggle/input/ext-market/train/train.csv')","metadata":{"execution":{"iopub.status.busy":"2023-07-20T07:37:20.850772Z","iopub.execute_input":"2023-07-20T07:37:20.851275Z","iopub.status.idle":"2023-07-20T07:37:21.755402Z","shell.execute_reply.started":"2023-07-20T07:37:20.851244Z","shell.execute_reply":"2023-07-20T07:37:21.754200Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# 3.Remove nan ","metadata":{}},{"cell_type":"code","source":"train = train.replace((np.inf, -np.inf, np.nan), 0).reset_index(drop=True)\ntest = test.replace((np.inf, -np.inf, np.nan), 0).reset_index(drop=True)\n\nprint('Shape train =', train.shape)\nprint('Shape test =', test.shape)","metadata":{"execution":{"iopub.status.busy":"2023-07-20T07:37:21.756807Z","iopub.execute_input":"2023-07-20T07:37:21.757276Z","iopub.status.idle":"2023-07-20T07:37:36.916730Z","shell.execute_reply.started":"2023-07-20T07:37:21.757233Z","shell.execute_reply":"2023-07-20T07:37:36.915398Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"test = test.drop(columns=['id'])\nprint('Shape train =', train.shape)\nprint('Shape test =', test.shape)","metadata":{"execution":{"iopub.status.busy":"2023-07-20T07:37:36.917935Z","iopub.execute_input":"2023-07-20T07:37:36.918262Z","iopub.status.idle":"2023-07-20T07:37:36.952535Z","shell.execute_reply.started":"2023-07-20T07:37:36.918235Z","shell.execute_reply":"2023-07-20T07:37:36.951421Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# 4.Aggregate Featrues","metadata":{}},{"cell_type":"code","source":"from sklearn.preprocessing import PowerTransformer\nfrom sklearn.preprocessing import QuantileTransformer\nfrom sklearn import preprocessing\nfrom sklearn.preprocessing import MaxAbsScaler\nfrom sklearn.preprocessing import MinMaxScaler\nfrom sklearn.preprocessing import RobustScaler\nfrom sklearn.preprocessing import OrdinalEncoder","metadata":{"execution":{"iopub.status.busy":"2023-07-20T07:37:36.954003Z","iopub.execute_input":"2023-07-20T07:37:36.954363Z","iopub.status.idle":"2023-07-20T07:37:37.042815Z","shell.execute_reply.started":"2023-07-20T07:37:36.954334Z","shell.execute_reply":"2023-07-20T07:37:37.041629Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"text_type = train.select_dtypes(include=['object'])\ntext_list = [text_type.columns]\nprint(\"list of text\", text_list)","metadata":{"execution":{"iopub.status.busy":"2023-07-20T07:37:37.044282Z","iopub.execute_input":"2023-07-20T07:37:37.044698Z","iopub.status.idle":"2023-07-20T07:37:37.338013Z","shell.execute_reply.started":"2023-07-20T07:37:37.044657Z","shell.execute_reply":"2023-07-20T07:37:37.336702Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"number_list = train.select_dtypes(include=['float64', 'int64'])\nnumber_list = number_list.columns\nprint(\"list of number\", number_list)","metadata":{"execution":{"iopub.status.busy":"2023-07-20T07:37:37.344986Z","iopub.execute_input":"2023-07-20T07:37:37.346237Z","iopub.status.idle":"2023-07-20T07:37:37.672289Z","shell.execute_reply.started":"2023-07-20T07:37:37.346191Z","shell.execute_reply":"2023-07-20T07:37:37.671085Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"List_a = ['exchange', 'RSI_signal', 'Stoch_O_signal', 'fibonacci_signal',\n       'Bollinger_signal', 'ichimoku_c_signal']\n\nlable = OrdinalEncoder()\nfor i in List_a:\n    train.loc[:, i] = lable.fit_transform(train[[i]])\n    test.loc[:, i] = lable.fit_transform(test[[i]])\n\nprint('Shape train =', train.shape)\nprint('Shape test =', test.shape)","metadata":{"execution":{"iopub.status.busy":"2023-07-20T07:37:37.673587Z","iopub.execute_input":"2023-07-20T07:37:37.673908Z","iopub.status.idle":"2023-07-20T07:37:56.014452Z","shell.execute_reply.started":"2023-07-20T07:37:37.673881Z","shell.execute_reply":"2023-07-20T07:37:56.013281Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"list_b = [\n     'Stoch_O_d_value', 'Stoch_O_signal_value',\n        'pivot_point', 'pivot_support_1', 'pivot_resistance_1',\n        'pivot_support_2', 'pivot_resistance_2', 'pivot_support_3',\n        'pivot_resistance_3', 'VWAP_relative_short']\n\nfor i in list_b:\n    train[i+' +log'] = (train[i]+1).transform(np.log)\n    test[i+' +log'] =(test[i]+1).transform(np.log)\n######################################################\nfor i in list_b:\n    train[i+'+log1'] = (train[i]+1).transform(np.log1p)\n    test[i+'+log1'] =(test[i]+1).transform(np.log1p)\n######################################################\ntransform = PowerTransformer(method='yeo-johnson')\nfor i in list_b:\n    train[i+'+y_j'] = transform.fit_transform(train[[i]])\n    test[i+'+y_j'] = transform.fit_transform(test[[i]])\n######################################################\ntransform = QuantileTransformer(n_quantiles=10, random_state=0)\nfor i in list_b:\n    train[i+'+q_t'] = transform.fit_transform(train[[i]])\n    test[i+'+q_t'] = transform.fit_transform(test[[i]])\n######################################################\nfor i in list_b:\n    train[i+'+sqrt'] = (train[i]+1).transform(np.sqrt)\n    test[i+'+sqrt'] =(test[i]+1).transform(np.sqrt)\n######################################################\nmaxabs = MaxAbsScaler()\nfor i in list_b:\n    train[i+'+abs'] = maxabs.fit_transform(train[[i]])\n    test[i+'+abs'] =maxabs.fit_transform(test[[i]])\n######################################################\nminmax = MinMaxScaler()\nfor i in list_b:\n    train[i+'+minmax'] = minmax.fit_transform(train[[i]])\n    test[i+'+minmax'] = minmax.fit_transform(test[[i]])\n######################################################\nrob = RobustScaler()\nfor i in list_b:\n    train[i+'+rob'] = rob.fit_transform(train[[i]])\n    test[i+'+rob'] = rob.fit_transform(test[[i]])\n######################################################\nnorm = preprocessing.Normalizer()\nfor i in list_b:\n    train[i+'+norm'] = norm.fit_transform(train[[i]])\n    test[i+'+norm'] = norm.fit_transform(test[[i]])\n######################################################\n\nprint('Shape train =', train.shape)\nprint(\"Shape test =\", test.shape)","metadata":{"execution":{"iopub.status.busy":"2023-07-20T07:37:56.015875Z","iopub.execute_input":"2023-07-20T07:37:56.018169Z","iopub.status.idle":"2023-07-20T07:40:57.626081Z","shell.execute_reply.started":"2023-07-20T07:37:56.018099Z","shell.execute_reply":"2023-07-20T07:40:57.624521Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# 5.Polynomial Features labeled","metadata":{}},{"cell_type":"code","source":"def PolynomialFeatures_labeled(input_df,power):\n   \n    poly = preprocessing.PolynomialFeatures(power)\n    output_nparray = poly.fit_transform(input_df)\n    powers_nparray = poly.powers_\n\n    input_feature_names = list(input_df.columns)\n    target_feature_names = [\"Constant Term\"]\n    for feature_distillation in powers_nparray[1:]:\n        intermediary_label = \"\"\n        final_label = \"\"\n        for i in range(len(input_feature_names)):\n            if feature_distillation[i] == 0:\n                continue\n            else:\n                variable = input_feature_names[i]\n                power = feature_distillation[i]\n                intermediary_label = \"%s+%d\" % (variable,power)\n                if final_label == \"\":         #If the final label isn't yet specified\n                    final_label = intermediary_label\n                else:\n                    final_label = final_label + \"x\" + intermediary_label\n        target_feature_names.append(final_label)\n    output_df = pd.DataFrame(output_nparray, columns = target_feature_names)\n    return output_df\n\noutput_df = PolynomialFeatures_labeled(train.iloc[:,:10],2)\noutput_df_t = PolynomialFeatures_labeled(test.iloc[:,:10],2)","metadata":{"execution":{"iopub.status.busy":"2023-07-20T07:40:57.627717Z","iopub.execute_input":"2023-07-20T07:40:57.628076Z","iopub.status.idle":"2023-07-20T07:41:00.555834Z","shell.execute_reply.started":"2023-07-20T07:40:57.628017Z","shell.execute_reply":"2023-07-20T07:41:00.554877Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train =  pd.concat([train.reset_index(drop=True), output_df], axis = 1)\ntest = pd.concat([test.reset_index(drop=True), output_df_t], axis = 1)\n\nprint('Shape train =', train.shape)\nprint('Shape test =', test.shape)","metadata":{"execution":{"iopub.status.busy":"2023-07-20T07:41:00.557580Z","iopub.execute_input":"2023-07-20T07:41:00.558304Z","iopub.status.idle":"2023-07-20T07:41:09.026600Z","shell.execute_reply.started":"2023-07-20T07:41:00.558264Z","shell.execute_reply":"2023-07-20T07:41:09.025631Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train = train.replace((np.inf, -np.inf, np.nan), 0).reset_index(drop=True)\ntest = test.replace((np.inf, -np.inf, np.nan), 0).reset_index(drop=True)\n\nprint('Shape train =', train.shape)\nprint('Shape test =', test.shape)","metadata":{"execution":{"iopub.status.busy":"2023-07-20T07:41:09.028223Z","iopub.execute_input":"2023-07-20T07:41:09.028741Z","iopub.status.idle":"2023-07-20T07:41:31.164409Z","shell.execute_reply.started":"2023-07-20T07:41:09.028701Z","shell.execute_reply":"2023-07-20T07:41:31.163209Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# 6.StandardScaler and feature_selection","metadata":{}},{"cell_type":"code","source":"from sklearn.feature_selection import VarianceThreshold\ndef variance_threshold(df,th):\n    var_thres=VarianceThreshold(threshold=th)\n    var_thres.fit(df)\n    new_cols = var_thres.get_support()\n    return df.iloc[:,new_cols]","metadata":{"execution":{"iopub.status.busy":"2023-07-20T07:41:31.165832Z","iopub.execute_input":"2023-07-20T07:41:31.166260Z","iopub.status.idle":"2023-07-20T07:41:31.526712Z","shell.execute_reply.started":"2023-07-20T07:41:31.166231Z","shell.execute_reply":"2023-07-20T07:41:31.525470Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"X = variance_threshold(train.drop(['result'],axis=1),0.7)\ny = train['result']\nlist_name = (X.columns)\ntest = test[list_name]\n\nprint('Shape train =', X.shape)\nprint('Shape test =', test.shape)","metadata":{"execution":{"iopub.status.busy":"2023-07-20T07:41:31.528370Z","iopub.execute_input":"2023-07-20T07:41:31.528801Z","iopub.status.idle":"2023-07-20T07:41:41.558367Z","shell.execute_reply.started":"2023-07-20T07:41:31.528759Z","shell.execute_reply":"2023-07-20T07:41:41.557001Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"from sklearn.model_selection import train_test_split\nX_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.55, random_state=42)","metadata":{"execution":{"iopub.status.busy":"2023-07-20T07:41:41.559852Z","iopub.execute_input":"2023-07-20T07:41:41.560329Z","iopub.status.idle":"2023-07-20T07:41:45.397431Z","shell.execute_reply.started":"2023-07-20T07:41:41.560288Z","shell.execute_reply":"2023-07-20T07:41:45.396441Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# 7.Parametrs","metadata":{}},{"cell_type":"code","source":"import optuna\nfrom sklearn import metrics\nfrom sklearn.metrics import accuracy_score, confusion_matrix,classification_report\nfrom sklearn.model_selection import KFold, StratifiedKFold, train_test_split\nimport catboost\nfrom catboost import *\nfrom catboost import CatBoostClassifier\nimport xgboost as xgb\nimport lightgbm as lgb\nfrom sklearn.preprocessing import StandardScaler\nfrom sklearn.pipeline import Pipeline\nfrom sklearn.metrics import roc_auc_score\nfrom sklearn.neural_network import MLPClassifier","metadata":{"execution":{"iopub.status.busy":"2023-07-20T07:41:45.398700Z","iopub.execute_input":"2023-07-20T07:41:45.399008Z","iopub.status.idle":"2023-07-20T07:41:47.702618Z","shell.execute_reply.started":"2023-07-20T07:41:45.398983Z","shell.execute_reply":"2023-07-20T07:41:47.701486Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"early_stopping_rounds = 50\nn_splits=5\nshuffle=True\nrandom_state = 2023\n\ncat_p = { 'iterations': 350,\n           'learning_rate': 0.007,\n           'depth': 5,\n           'l2_leaf_reg': 0.06,\n           'bootstrap_type': 'Bayesian',\n           'random_strength': 0.006,\n           'bagging_temperature': 1.70,\n           'od_type': 'Iter'}\n\nlgb_p = {'n_estimators': 350,\n           'num_leaves': 39,\n           'feature_fraction': 0.99,\n           'bagging_fraction': 0.43,\n           'bagging_freq': 1,\n           'min_child_samples': 29}\n\nxgb_p = {'n_estimators': 350,\n           'booster': 'gbtree',\n           'lambda': 1.082e-07,\n           'alpha': 0.005,\n           'subsample': 0.45,\n           'colsample_bytree': 0.36,\n           'max_depth': 5,\n           'min_child_weight': 5,\n           'eta': 5.74e-05,\n           'gamma': 0.73,\n           'grow_policy': 'lossguide',\n           'sample_type': 'weighted',\n           'normalize_type': 'forest'}","metadata":{"execution":{"iopub.status.busy":"2023-07-20T07:41:47.704440Z","iopub.execute_input":"2023-07-20T07:41:47.704964Z","iopub.status.idle":"2023-07-20T07:41:47.713253Z","shell.execute_reply.started":"2023-07-20T07:41:47.704934Z","shell.execute_reply":"2023-07-20T07:41:47.711891Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"from mlxtend.classifier import StackingCVClassifier\nfrom sklearn.calibration import CalibratedClassifierCV\nfrom sklearn.ensemble import RandomForestClassifier\nfrom sklearn.ensemble import AdaBoostClassifier\nfrom sklearn.linear_model import LogisticRegression\nfrom sklearn.ensemble import HistGradientBoostingClassifier","metadata":{"execution":{"iopub.status.busy":"2023-07-20T07:41:47.714390Z","iopub.execute_input":"2023-07-20T07:41:47.714707Z","iopub.status.idle":"2023-07-20T07:41:47.943436Z","shell.execute_reply.started":"2023-07-20T07:41:47.714680Z","shell.execute_reply":"2023-07-20T07:41:47.942554Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# 8.Compare","metadata":{}},{"cell_type":"code","source":"clf1 = Pipeline([('scale',StandardScaler()),\n                 ('clf1',CatBoostClassifier(**cat_p,\n                                            early_stopping_rounds=early_stopping_rounds,\n                                            verbose = 0))])\n\nclf2 = Pipeline([('scale',StandardScaler()),\n                 ('clf2',xgb.XGBClassifier(**xgb_p))])\n\nclf3 = Pipeline([('scale',StandardScaler()),\n                 ('cslf3',lgb.LGBMClassifier(**lgb_p))])\n\nclf4 = Pipeline([('scale',StandardScaler()),\n                 ('clf4',RandomForestClassifier(n_estimators = 350,\n                                                max_features = 5,\n                                                min_samples_split = 5,\n                                                max_depth = 2,\n                                                n_jobs=-1))])\n\nclf5 = Pipeline([('scale',StandardScaler()),\n                 ('clf5',HistGradientBoostingClassifier(max_iter = 350))])\n\n\n##############################################################################################################\n\nsclf = Pipeline([('scale',StandardScaler()),\n                 ('stak',StackingCVClassifier(classifiers = [clf1,\n                                                             clf2,\n                                                             clf3,\n                                                             clf4,\n                                                             clf5],                                                            \n                                              shuffle = False,\n                                              use_probas = True,\n                                              cv = StratifiedKFold(n_splits=n_splits,\n                                                                   shuffle=shuffle ,\n                                                                   random_state=random_state),\n                                              meta_classifier = CatBoostClassifier(**cat_p,\n                                                                                   early_stopping_rounds=early_stopping_rounds,\n                                                                                   verbose = 0)))])\n##############################################################################################################\nclassifiers = {\"cat\": clf1,\n               \"xgb\": clf2,\n               \"lgb\": clf3,\n               'calib1':clf4,\n               'calib2':clf5,\n               \"Stack\": sclf}\n##############################################################################################################\nfor key in classifiers:\n    # Get classifier\n    classifier = classifiers[key]\n    \n    # Fit classifier\n    classifier.fit(X_train, y_train)\n        \n    # Save fitted classifier\n    classifiers[key] = classifier","metadata":{"execution":{"iopub.status.busy":"2023-07-20T07:42:18.943376Z","iopub.execute_input":"2023-07-20T07:42:18.943820Z","iopub.status.idle":"2023-07-20T07:51:36.392328Z","shell.execute_reply.started":"2023-07-20T07:42:18.943785Z","shell.execute_reply":"2023-07-20T07:51:36.391052Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# 9.Predict","metadata":{}},{"cell_type":"code","source":"for key in classifiers:\n    # Make prediction on test set\n    y_pred = classifiers[key].predict(test)","metadata":{"execution":{"iopub.status.busy":"2023-07-20T07:51:36.394740Z","iopub.execute_input":"2023-07-20T07:51:36.395172Z","iopub.status.idle":"2023-07-20T07:51:39.039317Z","shell.execute_reply.started":"2023-07-20T07:51:36.395126Z","shell.execute_reply":"2023-07-20T07:51:39.038182Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# 10.Submit","metadata":{}},{"cell_type":"code","source":"sub = pd.read_csv('/kaggle/input/ext-market/sample_submission.csv')\nsub['result'] = y_pred\nsub","metadata":{"execution":{"iopub.status.busy":"2023-07-20T07:51:39.040864Z","iopub.execute_input":"2023-07-20T07:51:39.041266Z","iopub.status.idle":"2023-07-20T07:51:39.127362Z","shell.execute_reply.started":"2023-07-20T07:51:39.041234Z","shell.execute_reply":"2023-07-20T07:51:39.126172Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"sub.to_csv('submission.csv', index=False)","metadata":{"execution":{"iopub.status.busy":"2023-07-20T07:51:39.129725Z","iopub.execute_input":"2023-07-20T07:51:39.130093Z","iopub.status.idle":"2023-07-20T07:51:39.392964Z","shell.execute_reply.started":"2023-07-20T07:51:39.130060Z","shell.execute_reply":"2023-07-20T07:51:39.392095Z"},"trusted":true},"execution_count":null,"outputs":[]}]}