{"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-04T17:43:02.405480Z","iopub.execute_input":"2023-01-04T17:43:02.406324Z","iopub.status.idle":"2023-01-04T17:43:06.409838Z","shell.execute_reply.started":"2023-01-04T17:43:02.406226Z","shell.execute_reply":"2023-01-04T17:43:06.408523Z"},"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-04T17:43:06.412131Z","iopub.execute_input":"2023-01-04T17:43:06.412915Z","iopub.status.idle":"2023-01-04T17:43:06.424082Z","shell.execute_reply.started":"2023-01-04T17:43:06.412864Z","shell.execute_reply":"2023-01-04T17:43:06.422502Z"},"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-04T17:43:06.427954Z","iopub.execute_input":"2023-01-04T17:43:06.428343Z","iopub.status.idle":"2023-01-04T17:43:23.390288Z","shell.execute_reply.started":"2023-01-04T17:43:06.428312Z","shell.execute_reply":"2023-01-04T17:43:23.389108Z"},"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-04T17:43:23.393416Z","iopub.execute_input":"2023-01-04T17:43:23.394097Z","iopub.status.idle":"2023-01-04T17:43:23.431885Z","shell.execute_reply.started":"2023-01-04T17:43:23.394048Z","shell.execute_reply":"2023-01-04T17:43:23.430349Z"},"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-04T17:43:23.433553Z","iopub.execute_input":"2023-01-04T17:43:23.434037Z","iopub.status.idle":"2023-01-04T17:43:23.552485Z","shell.execute_reply.started":"2023-01-04T17:43:23.433991Z","shell.execute_reply":"2023-01-04T17:43:23.551186Z"},"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-04T17:43:23.553781Z","iopub.execute_input":"2023-01-04T17:43:23.554127Z","iopub.status.idle":"2023-01-04T17:43:36.753640Z","shell.execute_reply.started":"2023-01-04T17:43:23.554095Z","shell.execute_reply":"2023-01-04T17:43:36.752456Z"},"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-04T17:43:36.755095Z","iopub.execute_input":"2023-01-04T17:43:36.755478Z","iopub.status.idle":"2023-01-04T17:43:36.948681Z","shell.execute_reply.started":"2023-01-04T17:43:36.755446Z","shell.execute_reply":"2023-01-04T17:43:36.947503Z"},"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-04T17:43:36.950430Z","iopub.execute_input":"2023-01-04T17:43:36.951135Z","iopub.status.idle":"2023-01-04T17:43:37.264715Z","shell.execute_reply.started":"2023-01-04T17:43:36.951090Z","shell.execute_reply":"2023-01-04T17:43:37.263793Z"},"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-04T17:43:37.266118Z","iopub.execute_input":"2023-01-04T17:43:37.266720Z","iopub.status.idle":"2023-01-04T17:43:37.422290Z","shell.execute_reply.started":"2023-01-04T17:43:37.266684Z","shell.execute_reply":"2023-01-04T17:43:37.421012Z"},"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-04T17:43:37.426980Z","iopub.execute_input":"2023-01-04T17:43:37.427562Z","iopub.status.idle":"2023-01-04T17:43:39.441066Z","shell.execute_reply.started":"2023-01-04T17:43:37.427515Z","shell.execute_reply":"2023-01-04T17:43:39.439630Z"},"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-04T17:43:39.442314Z","iopub.execute_input":"2023-01-04T17:43:39.442650Z","iopub.status.idle":"2023-01-04T17:43:39.782492Z","shell.execute_reply.started":"2023-01-04T17:43:39.442620Z","shell.execute_reply":"2023-01-04T17:43:39.781202Z"},"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-04T17:43:39.783909Z","iopub.execute_input":"2023-01-04T17:43:39.784286Z","iopub.status.idle":"2023-01-04T17:43:40.979930Z","shell.execute_reply.started":"2023-01-04T17:43:39.784252Z","shell.execute_reply":"2023-01-04T17:43:40.978587Z"},"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-04T17:43:40.981478Z","iopub.execute_input":"2023-01-04T17:43:40.981832Z","iopub.status.idle":"2023-01-04T17:43:43.437391Z","shell.execute_reply.started":"2023-01-04T17:43:40.981800Z","shell.execute_reply":"2023-01-04T17:43:43.435882Z"},"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-04T17:43:43.439194Z","iopub.execute_input":"2023-01-04T17:43:43.439716Z","iopub.status.idle":"2023-01-04T17:43:45.986945Z","shell.execute_reply.started":"2023-01-04T17:43:43.439671Z","shell.execute_reply":"2023-01-04T17:43:45.986029Z"},"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-04T17:43:45.988298Z","iopub.execute_input":"2023-01-04T17:43:45.988856Z","iopub.status.idle":"2023-01-04T17:43:50.515195Z","shell.execute_reply.started":"2023-01-04T17:43:45.988821Z","shell.execute_reply":"2023-01-04T17:43:50.514288Z"},"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-04T17:43:50.516671Z","iopub.execute_input":"2023-01-04T17:43:50.517297Z","iopub.status.idle":"2023-01-04T17:43:50.676341Z","shell.execute_reply.started":"2023-01-04T17:43:50.517260Z","shell.execute_reply":"2023-01-04T17:43:50.675190Z"},"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-04T17:43:50.678364Z","iopub.execute_input":"2023-01-04T17:43:50.679128Z","iopub.status.idle":"2023-01-04T17:43:50.943032Z","shell.execute_reply.started":"2023-01-04T17:43:50.679090Z","shell.execute_reply":"2023-01-04T17:43:50.941863Z"},"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-04T17:43:50.944451Z","iopub.execute_input":"2023-01-04T17:43:50.944832Z","iopub.status.idle":"2023-01-04T17:43:51.103658Z","shell.execute_reply.started":"2023-01-04T17:43:50.944798Z","shell.execute_reply":"2023-01-04T17:43:51.102557Z"},"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-04T17:43:51.104915Z","iopub.execute_input":"2023-01-04T17:43:51.105293Z","iopub.status.idle":"2023-01-04T17:43:52.949700Z","shell.execute_reply.started":"2023-01-04T17:43:51.105258Z","shell.execute_reply":"2023-01-04T17:43:52.948432Z"},"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-04T17:43:52.951115Z","iopub.execute_input":"2023-01-04T17:43:52.952062Z","iopub.status.idle":"2023-01-04T17:43:53.839455Z","shell.execute_reply.started":"2023-01-04T17:43:52.952023Z","shell.execute_reply":"2023-01-04T17:43:53.838013Z"},"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-04T17:43:53.840998Z","iopub.execute_input":"2023-01-04T17:43:53.841438Z","iopub.status.idle":"2023-01-04T17:53:29.312420Z","shell.execute_reply.started":"2023-01-04T17:43:53.841404Z","shell.execute_reply":"2023-01-04T17:53:29.311280Z"},"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-04T17:53:29.314042Z","iopub.execute_input":"2023-01-04T17:53:29.314533Z","iopub.status.idle":"2023-01-04T17:54:00.089773Z","shell.execute_reply.started":"2023-01-04T17:53:29.314488Z","shell.execute_reply":"2023-01-04T17:54:00.088293Z"},"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-04T17:54:00.091831Z","iopub.execute_input":"2023-01-04T17:54:00.092806Z","iopub.status.idle":"2023-01-04T17:54:30.949685Z","shell.execute_reply.started":"2023-01-04T17:54:00.092753Z","shell.execute_reply":"2023-01-04T17:54:30.948359Z"},"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-04T17:54:30.951183Z","iopub.execute_input":"2023-01-04T17:54:30.951666Z","iopub.status.idle":"2023-01-04T17:55:10.903879Z","shell.execute_reply.started":"2023-01-04T17:54:30.951618Z","shell.execute_reply":"2023-01-04T17:55:10.902590Z"},"trusted":true},"execution_count":null,"outputs":[]}]}