{"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\nimport seaborn as sns\nimport matplotlib.pyplot as plt\n\nfrom sklearn.ensemble import RandomForestClassifier\nfrom sklearn.model_selection import train_test_split\n\nfrom fastai.tabular.core import cont_cat_split\n\nfrom yellowbrick.classifier import confusion_matrix\nfrom yellowbrick.classifier.rocauc import roc_auc\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":{"_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","_kg_hide-input":false,"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","papermill":{"duration":3.964192,"end_time":"2022-12-28T20:23:10.738330","exception":false,"start_time":"2022-12-28T20:23:06.774138","status":"completed"},"tags":[],"execution":{"iopub.status.busy":"2023-01-06T13:21:44.608554Z","iopub.execute_input":"2023-01-06T13:21:44.609062Z","iopub.status.idle":"2023-01-06T13:21:48.607002Z","shell.execute_reply.started":"2023-01-06T13:21:44.608966Z","shell.execute_reply":"2023-01-06T13:21:48.605740Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"def basic_info(df:pd.DataFrame):\n    s = \"\"\n    count = 1\n    for c in df.columns:\n        s+= f\"{count} - {c}\\n\"\n        s+= f\"    No. of unique values {df[c].nunique()}\\n\"\n        s+= f\"    Sample of unique values {df[c].unique()[0:10]}\\n\"\n        s+= \"\\n\"\n        count += 1\n    return s\n\n\ndef expand_feature_27(data):\n    # This function was adapted from the following notebooks:\n    # https://www.kaggle.com/code/paultimothymooney/getting-started-with-tensorflow-decision-forests\n    for df in [data]:\n        # Extract the 10 letters of f_27 into individual features\n        for i in range(10):   # defines a number from 0 to 25 for each letter, for example if ch1 is A then get 0 and so on\n            df[f'ch{i}'] = df.f_27.str.get(i).apply(ord) - ord('A')\n    return data","metadata":{"papermill":{"duration":0.019155,"end_time":"2022-12-28T20:23:10.765019","exception":false,"start_time":"2022-12-28T20:23:10.745864","status":"completed"},"tags":[],"execution":{"iopub.status.busy":"2023-01-06T13:21:48.609212Z","iopub.execute_input":"2023-01-06T13:21:48.611415Z","iopub.status.idle":"2023-01-06T13:21:48.621257Z","shell.execute_reply.started":"2023-01-06T13:21:48.611378Z","shell.execute_reply":"2023-01-06T13:21:48.619622Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# Exploratory data analysis and feature engineering","metadata":{"papermill":{"duration":0.006682,"end_time":"2022-12-28T20:23:10.778899","exception":false,"start_time":"2022-12-28T20:23:10.772217","status":"completed"},"tags":[]}},{"cell_type":"code","source":"# loading the data into a pandas DataFrame (for exploratory analysis)\ntrain_df = pd.read_csv('/kaggle/input/emsi-5iir-ds/train.csv')    # reading training file\ntest_df = pd.read_csv('/kaggle/input/emsi-5iir-ds/test.csv')    # reading test file\ntrain_df.shape    # viewing dataframe dimension","metadata":{"papermill":{"duration":17.392582,"end_time":"2022-12-28T20:23:28.178417","exception":false,"start_time":"2022-12-28T20:23:10.785835","status":"completed"},"tags":[],"execution":{"iopub.status.busy":"2023-01-06T13:21:48.622986Z","iopub.execute_input":"2023-01-06T13:21:48.624093Z","iopub.status.idle":"2023-01-06T13:22:08.492517Z","shell.execute_reply.started":"2023-01-06T13:21:48.624058Z","shell.execute_reply":"2023-01-06T13:22:08.491399Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train_df.head()    # viewing some examples","metadata":{"papermill":{"duration":0.049773,"end_time":"2022-12-28T20:23:28.235451","exception":false,"start_time":"2022-12-28T20:23:28.185678","status":"completed"},"tags":[],"execution":{"iopub.status.busy":"2023-01-06T13:22:08.494899Z","iopub.execute_input":"2023-01-06T13:22:08.495303Z","iopub.status.idle":"2023-01-06T13:22:08.532914Z","shell.execute_reply.started":"2023-01-06T13:22:08.495275Z","shell.execute_reply":"2023-01-06T13:22:08.531666Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train_df.info()    # information about the data, number of non-null (non-missing) values and the data type","metadata":{"papermill":{"duration":0.142103,"end_time":"2022-12-28T20:23:28.385060","exception":false,"start_time":"2022-12-28T20:23:28.242957","status":"completed"},"tags":[],"execution":{"iopub.status.busy":"2023-01-06T13:22:08.535140Z","iopub.execute_input":"2023-01-06T13:22:08.536074Z","iopub.status.idle":"2023-01-06T13:22:08.662890Z","shell.execute_reply.started":"2023-01-06T13:22:08.536026Z","shell.execute_reply":"2023-01-06T13:22:08.661825Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# Expanding feature 27 to more features, each additional feature represents a character from feature 27\n# as we know that the strings in feature 27 consist of 10 characters, so we will have 10 new features, each representing\n# a character (ch1, ch2, ch3, etc) containing an integer numeric value representing a letter of the alphabet, from 0 to 25\n# if the character 1 is the letter a, then the feature will receive 0, if it is b, it will receive 1 and so on\ntrain_df = expand_feature_27(train_df)\ntest_df = expand_feature_27(test_df)\ntrain_df.columns","metadata":{"papermill":{"duration":13.332049,"end_time":"2022-12-28T20:23:41.727556","exception":false,"start_time":"2022-12-28T20:23:28.395507","status":"completed"},"tags":[],"execution":{"iopub.status.busy":"2023-01-06T13:22:08.664267Z","iopub.execute_input":"2023-01-06T13:22:08.664742Z","iopub.status.idle":"2023-01-06T13:22:21.282963Z","shell.execute_reply.started":"2023-01-06T13:22:08.664699Z","shell.execute_reply":"2023-01-06T13:22:21.281877Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train_df[['f_27', 'ch0', 'ch1', 'ch2', 'ch3', 'ch4', 'ch5', 'ch6', 'ch7', 'ch8', 'ch9',]]","metadata":{"papermill":{"duration":0.301959,"end_time":"2022-12-28T20:23:42.038743","exception":false,"start_time":"2022-12-28T20:23:41.736784","status":"completed"},"tags":[],"execution":{"iopub.status.busy":"2023-01-06T13:22:21.284517Z","iopub.execute_input":"2023-01-06T13:22:21.285005Z","iopub.status.idle":"2023-01-06T13:22:21.534459Z","shell.execute_reply.started":"2023-01-06T13:22:21.284963Z","shell.execute_reply":"2023-01-06T13:22:21.533365Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# dropping features that are not needed for training, as feature 27 has been expanded to others with numerical values, \n# it is no longer needed\ntrain_df = train_df.drop(columns=['id', 'f_27'])\ntest_df = test_df.drop(columns=['id', 'f_27'])","metadata":{"papermill":{"duration":0.483526,"end_time":"2022-12-28T20:23:42.530605","exception":false,"start_time":"2022-12-28T20:23:42.047079","status":"completed"},"tags":[],"execution":{"iopub.status.busy":"2023-01-06T13:22:21.537649Z","iopub.execute_input":"2023-01-06T13:22:21.538015Z","iopub.status.idle":"2023-01-06T13:22:22.097138Z","shell.execute_reply.started":"2023-01-06T13:22:21.537983Z","shell.execute_reply":"2023-01-06T13:22:22.095808Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# spliting continuous from categorical variables, and displaying their names\ncont_col, cat_col = cont_cat_split(train_df)\nprint(f'Continuous Columns: {cont_col}\\n')\nprint(f'Categorical Columns: {cat_col}')","metadata":{"papermill":{"duration":0.17375,"end_time":"2022-12-28T20:23:42.712413","exception":false,"start_time":"2022-12-28T20:23:42.538663","status":"completed"},"tags":[],"execution":{"iopub.status.busy":"2023-01-06T13:22:22.099158Z","iopub.execute_input":"2023-01-06T13:22:22.099924Z","iopub.status.idle":"2023-01-06T13:22:22.268512Z","shell.execute_reply.started":"2023-01-06T13:22:22.099878Z","shell.execute_reply":"2023-01-06T13:22:22.267318Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"print(basic_info(train_df[cont_col]))    # printing basic information of continuous variables","metadata":{"papermill":{"duration":2.884631,"end_time":"2022-12-28T20:23:45.605290","exception":false,"start_time":"2022-12-28T20:23:42.720659","status":"completed"},"tags":[],"execution":{"iopub.status.busy":"2023-01-06T13:22:22.272105Z","iopub.execute_input":"2023-01-06T13:22:22.272700Z","iopub.status.idle":"2023-01-06T13:22:24.571958Z","shell.execute_reply.started":"2023-01-06T13:22:22.272661Z","shell.execute_reply":"2023-01-06T13:22:24.570638Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"print(basic_info(train_df[cat_col]))    # printing basic information of categorical variables","metadata":{"papermill":{"duration":0.392221,"end_time":"2022-12-28T20:23:46.006035","exception":false,"start_time":"2022-12-28T20:23:45.613814","status":"completed"},"tags":[],"execution":{"iopub.status.busy":"2023-01-06T13:22:24.575314Z","iopub.execute_input":"2023-01-06T13:22:24.575682Z","iopub.status.idle":"2023-01-06T13:22:24.927607Z","shell.execute_reply.started":"2023-01-06T13:22:24.575651Z","shell.execute_reply":"2023-01-06T13:22:24.926253Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"sns.heatmap(abs(train_df[cont_col].corr()))    # visualizing the correlation between the continuous variables","metadata":{"papermill":{"duration":1.270543,"end_time":"2022-12-28T20:23:47.285151","exception":false,"start_time":"2022-12-28T20:23:46.014608","status":"completed"},"tags":[],"execution":{"iopub.status.busy":"2023-01-06T13:22:24.928755Z","iopub.execute_input":"2023-01-06T13:22:24.929071Z","iopub.status.idle":"2023-01-06T13:22:26.167827Z","shell.execute_reply.started":"2023-01-06T13:22:24.929043Z","shell.execute_reply":"2023-01-06T13:22:26.166744Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"sns.heatmap(abs(train_df[cat_col].corr()))    # visualizing the correlation between the categorical variables","metadata":{"papermill":{"duration":2.639837,"end_time":"2022-12-28T20:23:49.934936","exception":false,"start_time":"2022-12-28T20:23:47.295099","status":"completed"},"tags":[],"execution":{"iopub.status.busy":"2023-01-06T13:22:26.169509Z","iopub.execute_input":"2023-01-06T13:22:26.169976Z","iopub.status.idle":"2023-01-06T13:22:28.938355Z","shell.execute_reply.started":"2023-01-06T13:22:26.169932Z","shell.execute_reply":"2023-01-06T13:22:28.937230Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# plotting boxplot to visualize the distribution of values of continuous variables\ni = 0\n# creating a figure with dimensions equal to the square root of the number of continuous variables\nbox_fig, box_axs = plt.subplots(int(np.sqrt(len(cont_col))), int(np.sqrt(len(cont_col))), figsize=(20, 18))\nfor ax in box_fig.get_axes():    # looping through the axes created for the figure (4x4)\n    sns.boxplot(x=train_df[cont_col[i]], hue=train_df['target'], ax=ax)    # plotting the boxplot for each variable\n    i += 1\nplt.show()","metadata":{"papermill":{"duration":2.661748,"end_time":"2022-12-28T20:23:52.606588","exception":false,"start_time":"2022-12-28T20:23:49.944840","status":"completed"},"tags":[],"execution":{"iopub.status.busy":"2023-01-06T13:22:28.939614Z","iopub.execute_input":"2023-01-06T13:22:28.939968Z","iopub.status.idle":"2023-01-06T13:22:31.429044Z","shell.execute_reply.started":"2023-01-06T13:22:28.939939Z","shell.execute_reply":"2023-01-06T13:22:31.427865Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# plotting bar to visualize the distribution of values of continuous variables\ni = 0\n# creating a figure with dimensions equal to the square root of the number of categorical variables\nbar_fig, bar_axs = plt.subplots(int(np.sqrt(len(cat_col))), int(np.sqrt(len(cat_col))), figsize=(20, 18))\nfor ax in bar_fig.get_axes():    # looping through the axes created for the figure (5x5)\n    train_df[cat_col[i]].value_counts().plot.bar(ax=ax, title=cat_col[i])    # plotting bar graph for each variable\n    i += 1\nplt.show()","metadata":{"papermill":{"duration":4.719661,"end_time":"2022-12-28T20:23:57.336497","exception":false,"start_time":"2022-12-28T20:23:52.616836","status":"completed"},"tags":[],"execution":{"iopub.status.busy":"2023-01-06T13:22:31.430287Z","iopub.execute_input":"2023-01-06T13:22:31.430614Z","iopub.status.idle":"2023-01-06T13:22:35.923629Z","shell.execute_reply.started":"2023-01-06T13:22:31.430553Z","shell.execute_reply":"2023-01-06T13:22:35.922722Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# checking how many percent each value of the categorical variables represents\n# creating a list with the names of the categorical variables that I want to check\nf_cat_col = ['f_07', 'f_08', 'f_09', 'f_10', 'f_11', 'f_12', 'f_13', 'f_14', 'f_15', 'f_16', 'f_17', 'f_18', ]\nfor column in f_cat_col:    # para cada variavel na lista\n    percent = train_df[column].value_counts(normalize=True) * 100    # calculates the relative frequency of unique values in percentage\n    display(percent)\n    print('\\n')","metadata":{"papermill":{"duration":0.191665,"end_time":"2022-12-28T20:23:57.539938","exception":false,"start_time":"2022-12-28T20:23:57.348273","status":"completed"},"tags":[],"execution":{"iopub.status.busy":"2023-01-06T13:22:35.924865Z","iopub.execute_input":"2023-01-06T13:22:35.925881Z","iopub.status.idle":"2023-01-06T13:22:36.084263Z","shell.execute_reply.started":"2023-01-06T13:22:35.925845Z","shell.execute_reply":"2023-01-06T13:22:36.083014Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# joining values with the very low percentage in a single\ntrain_df['f_07'] = train_df['f_07'].replace([5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15], 5)\ntrain_df['f_08'] = train_df['f_08'].replace([5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 16], 5)\ntrain_df['f_09'] = train_df['f_09'].replace([5, 6, 7, 8, 9, 10, 11, 12, 13, 14], 5)\ntrain_df['f_10'] = train_df['f_10'].replace([5, 6, 7, 8, 9, 10, 11, 12, 13, 14], 5)\ntrain_df['f_11'] = train_df['f_11'].replace([4, 5, 6, 7, 8, 9, 10, 11, 12, 13], 4)\ntrain_df['f_12'] = train_df['f_12'].replace([6, 7, 8, 9, 10, 11, 12, 13, 14, 16], 6)\ntrain_df['f_13'] = train_df['f_13'].replace([5, 6, 7, 8, 9, 10, 11, 12], 5)\ntrain_df['f_14'] = train_df['f_14'].replace([4, 5, 6, 7, 8, 9, 10, 11, 12, 14], 4)\ntrain_df['f_15'] = train_df['f_15'].replace([5, 6, 7, 8, 9, 10, 11, 12, 13, 14], 5)\ntrain_df['f_16'] = train_df['f_16'].replace([5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15], 5)\ntrain_df['f_17'] = train_df['f_17'].replace([4, 5, 6, 7, 8, 9, 10, 11, 12, 14], 4)\ntrain_df['f_18'] = train_df['f_15'].replace([5, 6, 7, 8, 9, 10, 11, 12, 13], 5)","metadata":{"papermill":{"duration":0.335662,"end_time":"2022-12-28T20:23:57.890063","exception":false,"start_time":"2022-12-28T20:23:57.554401","status":"completed"},"tags":[],"execution":{"iopub.status.busy":"2023-01-06T13:22:36.087717Z","iopub.execute_input":"2023-01-06T13:22:36.088093Z","iopub.status.idle":"2023-01-06T13:22:36.359590Z","shell.execute_reply.started":"2023-01-06T13:22:36.088058Z","shell.execute_reply":"2023-01-06T13:22:36.358551Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# checking again to see if the result is positive\nfor column in f_cat_col:\n    percent = train_df[column].value_counts(normalize=True) * 100\n    display(percent)\n    print('\\n')","metadata":{"papermill":{"duration":0.19247,"end_time":"2022-12-28T20:23:58.096729","exception":false,"start_time":"2022-12-28T20:23:57.904259","status":"completed"},"tags":[],"execution":{"iopub.status.busy":"2023-01-06T13:22:36.361042Z","iopub.execute_input":"2023-01-06T13:22:36.362154Z","iopub.status.idle":"2023-01-06T13:22:36.517226Z","shell.execute_reply.started":"2023-01-06T13:22:36.362109Z","shell.execute_reply":"2023-01-06T13:22:36.516039Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"i = 0\nbar2_fig, bar2_axs = plt.subplots(3, 4, figsize=(15, 10))\nfor ax in bar2_fig.get_axes():\n    train_df[f_cat_col[i]].value_counts().plot.bar(ax=ax, title=f_cat_col[i])\n    i += 1\nplt.show()","metadata":{"papermill":{"duration":1.989311,"end_time":"2022-12-28T20:24:00.101951","exception":false,"start_time":"2022-12-28T20:23:58.112640","status":"completed"},"tags":[],"execution":{"iopub.status.busy":"2023-01-06T13:22:36.518954Z","iopub.execute_input":"2023-01-06T13:22:36.519406Z","iopub.status.idle":"2023-01-06T13:22:38.364203Z","shell.execute_reply.started":"2023-01-06T13:22:36.519357Z","shell.execute_reply":"2023-01-06T13:22:38.362956Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# Model","metadata":{"papermill":{"duration":0.016628,"end_time":"2022-12-28T20:24:00.136635","exception":false,"start_time":"2022-12-28T20:24:00.120007","status":"completed"},"tags":[]}},{"cell_type":"code","source":"X = train_df.drop(columns=['target'])    # input\ny = train_df.target    # output\n\n# split the data into training and testing\nX_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.3, random_state=0, stratify=y)\n\nprint(f'X_train shape: {X_train.shape}')\nprint(f'y_train shape: {y_train.shape}')\nprint(f'-' * 27)\nprint(f'X_test shape: {X_test.shape}')\nprint(f'y_test shape: {y_test.shape}')","metadata":{"papermill":{"duration":1.222249,"end_time":"2022-12-28T20:24:01.375813","exception":false,"start_time":"2022-12-28T20:24:00.153564","status":"completed"},"tags":[],"execution":{"iopub.status.busy":"2023-01-06T13:22:38.365795Z","iopub.execute_input":"2023-01-06T13:22:38.366467Z","iopub.status.idle":"2023-01-06T13:22:39.382390Z","shell.execute_reply.started":"2023-01-06T13:22:38.366429Z","shell.execute_reply":"2023-01-06T13:22:39.381164Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"tps_model = RandomForestClassifier(random_state=0)\ntps_model.fit(X_train, y_train)","metadata":{"papermill":{"duration":668.30008,"end_time":"2022-12-28T20:35:09.692811","exception":false,"start_time":"2022-12-28T20:24:01.392731","status":"completed"},"tags":[],"execution":{"iopub.status.busy":"2023-01-06T13:22:39.383931Z","iopub.execute_input":"2023-01-06T13:22:39.384451Z","iopub.status.idle":"2023-01-06T13:32:29.631913Z","shell.execute_reply.started":"2023-01-06T13:22:39.384405Z","shell.execute_reply":"2023-01-06T13:32:29.630660Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# Metrics","metadata":{"papermill":{"duration":0.015951,"end_time":"2022-12-28T20:35:09.725603","exception":false,"start_time":"2022-12-28T20:35:09.709652","status":"completed"},"tags":[]}},{"cell_type":"code","source":"plt.figure(figsize=(6, 6))\nconfusion_matrix(tps_model, X_train, y_train, X_test, y_test, percent=True)\nplt.tight_layout()","metadata":{"papermill":{"duration":36.469584,"end_time":"2022-12-28T20:35:46.212084","exception":false,"start_time":"2022-12-28T20:35:09.742500","status":"completed"},"tags":[],"execution":{"iopub.status.busy":"2023-01-06T13:32:29.634253Z","iopub.execute_input":"2023-01-06T13:32:29.635044Z","iopub.status.idle":"2023-01-06T13:33:00.074650Z","shell.execute_reply.started":"2023-01-06T13:32:29.634996Z","shell.execute_reply":"2023-01-06T13:33:00.073137Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"plt.figure(figsize=(6, 6))\nroc_auc(tps_model, X_train, y_train, X_test=X_test, y_test=y_test)\nplt.tight_layout()","metadata":{"papermill":{"duration":36.584287,"end_time":"2022-12-28T20:36:22.813297","exception":false,"start_time":"2022-12-28T20:35:46.229010","status":"completed"},"tags":[],"execution":{"iopub.status.busy":"2023-01-06T13:33:00.076747Z","iopub.execute_input":"2023-01-06T13:33:00.077814Z","iopub.status.idle":"2023-01-06T13:33:30.500845Z","shell.execute_reply.started":"2023-01-06T13:33:00.077751Z","shell.execute_reply":"2023-01-06T13:33:30.499654Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# Submission","metadata":{"papermill":{"duration":0.017577,"end_time":"2022-12-28T20:36:22.849215","exception":false,"start_time":"2022-12-28T20:36:22.831638","status":"completed"},"tags":[]}},{"cell_type":"code","source":"sample_submission_df = pd.read_csv('/kaggle/input/emsi-5iir-ds/sample_submission.csv')\nsample_submission_df['target'] = tps_model.predict(test_df)\nsample_submission_df.to_csv('/kaggle/working/submission.csv', index=False)","metadata":{"papermill":{"duration":47.187802,"end_time":"2022-12-28T20:37:10.054943","exception":false,"start_time":"2022-12-28T20:36:22.867141","status":"completed"},"tags":[],"execution":{"iopub.status.busy":"2023-01-06T13:33:30.502524Z","iopub.execute_input":"2023-01-06T13:33:30.502993Z","iopub.status.idle":"2023-01-06T13:34:09.508556Z","shell.execute_reply.started":"2023-01-06T13:33:30.502948Z","shell.execute_reply":"2023-01-06T13:34:09.507656Z"},"trusted":true},"execution_count":null,"outputs":[]}]}