{"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":"markdown","source":"# Imports","metadata":{"id":"Dc5EmbUTacjH"}},{"cell_type":"code","source":"# Ignore Warnings\nimport warnings\nwarnings.filterwarnings(\"ignore\")\n\n# Data Manipulation, Linear Algebraa\nimport pandas as pd\nimport numpy as np\n\n# Plots\nimport matplotlib.pyplot as plt\nimport seaborn as sns\nsns.set_style(\"whitegrid\")\n\n# Viz for missing values\nimport missingno as mno\n\n# Data Preprocessing / Preprocessing\nfrom sklearn.impute import SimpleImputer\nfrom sklearn.preprocessing import StandardScaler\nfrom sklearn.model_selection import StratifiedShuffleSplit\nfrom sklearn import metrics","metadata":{"id":"4IXqzZy2akuF","execution":{"iopub.status.busy":"2022-08-09T10:57:07.408838Z","iopub.execute_input":"2022-08-09T10:57:07.409333Z","iopub.status.idle":"2022-08-09T10:57:09.086972Z","shell.execute_reply.started":"2022-08-09T10:57:07.409235Z","shell.execute_reply":"2022-08-09T10:57:09.085690Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# Data Preprocessing","metadata":{"id":"XMh007aqbFHO"}},{"cell_type":"markdown","source":"## Loading Data","metadata":{"id":"0qEz0EMJbH7l"}},{"cell_type":"code","source":"# Load the training and testing data\ntrain = pd.read_csv(\"../input/tabular-playground-series-aug-2022/train.csv\")\ntest = pd.read_csv(\"../input/tabular-playground-series-aug-2022/test.csv\")","metadata":{"id":"EO6F-jLZbEqw","execution":{"iopub.status.busy":"2022-08-09T10:57:09.089975Z","iopub.execute_input":"2022-08-09T10:57:09.090505Z","iopub.status.idle":"2022-08-09T10:57:09.449647Z","shell.execute_reply.started":"2022-08-09T10:57:09.090447Z","shell.execute_reply":"2022-08-09T10:57:09.448598Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"## Basic Analysis","metadata":{"id":"lplLwq8AbSkO"}},{"cell_type":"code","source":"# View train data\ntrain.head(5)","metadata":{"id":"SfPG0ekpbREb","outputId":"f702bdee-9bda-4f10-d4c5-de31ab6716d3","execution":{"iopub.status.busy":"2022-08-09T10:57:09.451385Z","iopub.execute_input":"2022-08-09T10:57:09.451806Z","iopub.status.idle":"2022-08-09T10:57:09.495176Z","shell.execute_reply.started":"2022-08-09T10:57:09.451773Z","shell.execute_reply":"2022-08-09T10:57:09.494300Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# View test data\ntest.head()","metadata":{"id":"mrZ0BheSbXHw","outputId":"fdbe4878-b47b-40f4-b67c-cc314f26efe8","execution":{"iopub.status.busy":"2022-08-09T10:57:09.497361Z","iopub.execute_input":"2022-08-09T10:57:09.497896Z","iopub.status.idle":"2022-08-09T10:57:09.524898Z","shell.execute_reply.started":"2022-08-09T10:57:09.497861Z","shell.execute_reply":"2022-08-09T10:57:09.524030Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# Train and test data shape\ntrain.shape, test.shape","metadata":{"id":"GVjgoEu7beau","outputId":"6eaf1c4a-7d02-46a2-dc0e-0cb837b4f8d1","execution":{"iopub.status.busy":"2022-08-09T10:57:09.526335Z","iopub.execute_input":"2022-08-09T10:57:09.527171Z","iopub.status.idle":"2022-08-09T10:57:09.539233Z","shell.execute_reply.started":"2022-08-09T10:57:09.527118Z","shell.execute_reply":"2022-08-09T10:57:09.538292Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# View the data info\ntrain.info()","metadata":{"id":"6LgZBaEtbmz8","outputId":"409db2b5-5ab7-402a-e1fc-03b634a4d56e","execution":{"iopub.status.busy":"2022-08-09T10:57:09.540675Z","iopub.execute_input":"2022-08-09T10:57:09.541256Z","iopub.status.idle":"2022-08-09T10:57:09.578795Z","shell.execute_reply.started":"2022-08-09T10:57:09.541222Z","shell.execute_reply":"2022-08-09T10:57:09.577439Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# View the data info\ntest.info()","metadata":{"id":"r39nzW8mcSLt","outputId":"12604395-c416-4542-dcc6-19ebef0b6317","execution":{"iopub.status.busy":"2022-08-09T10:57:09.580280Z","iopub.execute_input":"2022-08-09T10:57:09.581434Z","iopub.status.idle":"2022-08-09T10:57:09.598947Z","shell.execute_reply.started":"2022-08-09T10:57:09.581390Z","shell.execute_reply":"2022-08-09T10:57:09.598002Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"## Checking for Null Values","metadata":{"id":"-tXSTSBccU9l"}},{"cell_type":"code","source":"# Null values in train data\ntrain.isnull().sum()","metadata":{"id":"2d7TgFn8cSrV","outputId":"2f0c8cef-39bb-48f5-8efb-7c63ac91076d","execution":{"iopub.status.busy":"2022-08-09T10:57:09.600181Z","iopub.execute_input":"2022-08-09T10:57:09.600683Z","iopub.status.idle":"2022-08-09T10:57:09.614670Z","shell.execute_reply.started":"2022-08-09T10:57:09.600651Z","shell.execute_reply":"2022-08-09T10:57:09.613463Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# Null values in test data\ntest.isnull().sum()","metadata":{"id":"yB_TdU3WcWv6","outputId":"2a573553-186b-406c-f611-33544d0ca27d","execution":{"iopub.status.busy":"2022-08-09T10:57:09.616176Z","iopub.execute_input":"2022-08-09T10:57:09.617114Z","iopub.status.idle":"2022-08-09T10:57:09.632833Z","shell.execute_reply.started":"2022-08-09T10:57:09.617049Z","shell.execute_reply":"2022-08-09T10:57:09.631511Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# Viz training missing data\nmno.matrix(train, figsize = (20, 6))","metadata":{"id":"_CBhoDzCchLu","outputId":"3bc8e1d0-059b-4a5c-d979-73e51de76ce0","execution":{"iopub.status.busy":"2022-08-09T10:57:09.637973Z","iopub.execute_input":"2022-08-09T10:57:09.638937Z","iopub.status.idle":"2022-08-09T10:57:10.613232Z","shell.execute_reply.started":"2022-08-09T10:57:09.638895Z","shell.execute_reply":"2022-08-09T10:57:10.611668Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# Viz testing missing data\nmno.matrix(test, figsize = (20, 6))","metadata":{"id":"4aS8HA-Ac1M2","outputId":"a743d300-12d4-4d92-cb1d-fcf5377e0267","execution":{"iopub.status.busy":"2022-08-09T10:57:10.615005Z","iopub.execute_input":"2022-08-09T10:57:10.615794Z","iopub.status.idle":"2022-08-09T10:57:11.366217Z","shell.execute_reply.started":"2022-08-09T10:57:10.615756Z","shell.execute_reply":"2022-08-09T10:57:11.365047Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"## Dropping Columns","metadata":{"id":"WK79SfWMdDMW"}},{"cell_type":"code","source":"# Drop columns\ntrain.drop([\"id\", \"product_code\", \"attribute_0\", \"attribute_1\"], axis=1, inplace=True)\ntest.drop([\"id\", \"product_code\", \"attribute_0\", \"attribute_1\"], axis=1, inplace=True)","metadata":{"id":"Ao-t8wkZc4EF","execution":{"iopub.status.busy":"2022-08-09T10:57:11.367701Z","iopub.execute_input":"2022-08-09T10:57:11.368866Z","iopub.status.idle":"2022-08-09T10:57:11.379508Z","shell.execute_reply.started":"2022-08-09T10:57:11.368820Z","shell.execute_reply":"2022-08-09T10:57:11.378194Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"## Imputing Missing Values","metadata":{"id":"2jEYrWkHdXm_"}},{"cell_type":"code","source":"# Getting list of columns with null values\nnull_cols = list(train.columns[train.isnull().any()])\nnull_cols","metadata":{"id":"mf1drXhTdjuf","outputId":"3580ad39-d607-48f1-8664-8f81deabcde4","execution":{"iopub.status.busy":"2022-08-09T10:57:11.381015Z","iopub.execute_input":"2022-08-09T10:57:11.382220Z","iopub.status.idle":"2022-08-09T10:57:11.400365Z","shell.execute_reply.started":"2022-08-09T10:57:11.382175Z","shell.execute_reply":"2022-08-09T10:57:11.398856Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# Counting the number of columns with null values\nlen(null_cols)","metadata":{"id":"FrYW-VuzdguF","outputId":"e1c28ecf-cf86-4820-fe68-e730c1adad5e","execution":{"iopub.status.busy":"2022-08-09T10:57:11.402965Z","iopub.execute_input":"2022-08-09T10:57:11.404145Z","iopub.status.idle":"2022-08-09T10:57:11.411069Z","shell.execute_reply.started":"2022-08-09T10:57:11.404077Z","shell.execute_reply":"2022-08-09T10:57:11.409949Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# Set up the matplotlib figure\nf, axes = plt.subplots(4, 4, sharex=True, figsize=(24, 10))\nsns.despine(left=True)\n\ncol_num = 0\nfor i in range(4):\n    for j in range(4):\n        sns.distplot(train[null_cols[col_num]], kde=True, ax=axes[i, j])\n        col_num += 1\n\nplt.show()","metadata":{"id":"HzMpHlogf8YH","outputId":"8bb040fe-3c9b-4089-8b65-805a70317db1","execution":{"iopub.status.busy":"2022-08-09T10:57:11.412828Z","iopub.execute_input":"2022-08-09T10:57:11.413510Z","iopub.status.idle":"2022-08-09T10:57:17.590951Z","shell.execute_reply.started":"2022-08-09T10:57:11.413465Z","shell.execute_reply":"2022-08-09T10:57:17.589746Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# Initializing the imputer\nmedian_imp = SimpleImputer(missing_values=np.nan, strategy='median')\n\n# Imputing the null values\ntrain[null_cols[0]] = median_imp.fit_transform(train[null_cols[0]].values.reshape(-1, 1))\ntest[null_cols[0]] = median_imp.transform(test[null_cols[0]].values.reshape(-1, 1))","metadata":{"id":"otbdLarJgmgV","execution":{"iopub.status.busy":"2022-08-09T10:57:17.592394Z","iopub.execute_input":"2022-08-09T10:57:17.592784Z","iopub.status.idle":"2022-08-09T10:57:17.606417Z","shell.execute_reply.started":"2022-08-09T10:57:17.592751Z","shell.execute_reply":"2022-08-09T10:57:17.605475Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# Initializing the imputer\nmean_imp = SimpleImputer(missing_values=np.nan, strategy='mean')\n\n# Imputing the null values\nfor col in null_cols[1:]:\n    train[col] = mean_imp.fit_transform(train[col].values.reshape(-1, 1))\n    test[col] = mean_imp.transform(test[col].values.reshape(-1, 1))","metadata":{"id":"aMWndnRBid3o","execution":{"iopub.status.busy":"2022-08-09T10:57:17.607667Z","iopub.execute_input":"2022-08-09T10:57:17.608617Z","iopub.status.idle":"2022-08-09T10:57:17.650005Z","shell.execute_reply.started":"2022-08-09T10:57:17.608581Z","shell.execute_reply":"2022-08-09T10:57:17.648893Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# View train data\ntrain.head()","metadata":{"id":"JPkna6lsjIMH","outputId":"b42e65e4-f392-4706-a501-dfe16222645e","execution":{"iopub.status.busy":"2022-08-09T10:57:17.651486Z","iopub.execute_input":"2022-08-09T10:57:17.652117Z","iopub.status.idle":"2022-08-09T10:57:17.682135Z","shell.execute_reply.started":"2022-08-09T10:57:17.652061Z","shell.execute_reply":"2022-08-09T10:57:17.680826Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# View test data\ntest.head()","metadata":{"id":"3lDwmPJYjTG4","outputId":"ca4076ae-7e5c-4287-c6a6-04e2eb5bec03","execution":{"iopub.status.busy":"2022-08-09T10:57:17.683581Z","iopub.execute_input":"2022-08-09T10:57:17.684021Z","iopub.status.idle":"2022-08-09T10:57:17.713117Z","shell.execute_reply.started":"2022-08-09T10:57:17.683979Z","shell.execute_reply":"2022-08-09T10:57:17.711869Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"## Standardizing","metadata":{"id":"gJD5QtOaj1AG"}},{"cell_type":"code","source":"# Seperaing the features and target from training data\ntrain_X = train.drop(\"failure\", axis=1)\ntrain_y = train[\"failure\"]","metadata":{"id":"_3ul0QMWjeQS","execution":{"iopub.status.busy":"2022-08-09T10:57:17.714055Z","iopub.execute_input":"2022-08-09T10:57:17.714384Z","iopub.status.idle":"2022-08-09T10:57:17.728954Z","shell.execute_reply.started":"2022-08-09T10:57:17.714357Z","shell.execute_reply":"2022-08-09T10:57:17.728140Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# Initializng the scaler\nscaler = StandardScaler()\n\n# Scaling the data\ntrain_X = pd.DataFrame(scaler.fit_transform(train_X), columns=train_X.columns)\ntest = pd.DataFrame(scaler.transform(test), columns=test.columns)","metadata":{"id":"2KJCto1zje8S","execution":{"iopub.status.busy":"2022-08-09T10:57:17.730375Z","iopub.execute_input":"2022-08-09T10:57:17.730703Z","iopub.status.idle":"2022-08-09T10:57:17.762520Z","shell.execute_reply.started":"2022-08-09T10:57:17.730675Z","shell.execute_reply":"2022-08-09T10:57:17.761637Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# View the scaled train data\ntrain_X.head()","metadata":{"id":"DqnlFsSkkwra","outputId":"64813c00-f06f-476e-e352-26550e47b546","execution":{"iopub.status.busy":"2022-08-09T10:57:17.764236Z","iopub.execute_input":"2022-08-09T10:57:17.765032Z","iopub.status.idle":"2022-08-09T10:57:17.791851Z","shell.execute_reply.started":"2022-08-09T10:57:17.764986Z","shell.execute_reply":"2022-08-09T10:57:17.790645Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# View the scaled test data\ntest.head()","metadata":{"id":"LuyaGzMDk4JW","outputId":"0fc203e4-2086-497c-a047-4963a0e96fff","execution":{"iopub.status.busy":"2022-08-09T10:57:17.793280Z","iopub.execute_input":"2022-08-09T10:57:17.793642Z","iopub.status.idle":"2022-08-09T10:57:17.825326Z","shell.execute_reply.started":"2022-08-09T10:57:17.793609Z","shell.execute_reply":"2022-08-09T10:57:17.824149Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# Machine Learning","metadata":{"id":"nMr02lZuk9Ss"}},{"cell_type":"markdown","source":"## StratifiedShuffleSplit","metadata":{"id":"r5DstRo1lAJ-"}},{"cell_type":"code","source":"# Initiazling the Stratified Shuffle Split\nsss = StratifiedShuffleSplit(n_splits=1, test_size=0.2, random_state=42)\n\n# Splitting the data\nfor train_index, test_index in sss.split(train_X, train_y):\n    X_train, y_train = train_X.loc[train_index], train_y[train_index]\n    X_test, y_test = train_X.loc[test_index], train_y[test_index]","metadata":{"id":"kxCYPxnZk6FR","execution":{"iopub.status.busy":"2022-08-09T10:57:17.827372Z","iopub.execute_input":"2022-08-09T10:57:17.827988Z","iopub.status.idle":"2022-08-09T10:57:17.856559Z","shell.execute_reply.started":"2022-08-09T10:57:17.827941Z","shell.execute_reply":"2022-08-09T10:57:17.855559Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"## AutoML","metadata":{"id":"zhARAJTrnMlO"}},{"cell_type":"markdown","source":"### Global Constants form AutoML","metadata":{"id":"c-D5A9SXnR8-"}},{"cell_type":"code","source":"# CONSTANTS\nMAX_MODEL_RUNTIME_MINS = 10\nMAX_MODEL_RUNTIME_SECS = MAX_MODEL_RUNTIME_MINS * 60","metadata":{"id":"yoRVSPi6mWZd","execution":{"iopub.status.busy":"2022-08-09T10:57:17.858204Z","iopub.execute_input":"2022-08-09T10:57:17.858920Z","iopub.status.idle":"2022-08-09T10:57:17.864301Z","shell.execute_reply.started":"2022-08-09T10:57:17.858874Z","shell.execute_reply":"2022-08-09T10:57:17.863136Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"### Utility Functions","metadata":{"id":"fMCcTUELnWc2"}},{"cell_type":"code","source":"# Metrics to calculate the goodness of our trained model\ndef get_scores(actual, predicted):\n    # Calculate the accuracy on testing data\n    accuracy = metrics.accuracy_score(actual, predicted)\n    print(f\"Accuracy on tesing data: {accuracy * 100}%\")\n\n    # Calculating the confusion matrix\n    conf_matrix = metrics.confusion_matrix(actual, predicted)\n\n    sns.heatmap(conf_matrix)\n    plt.title(\"Confusion Matrix\")\n    plt.show()\n\n    # Calculating the classification report\n    class_report = metrics.classification_report(actual, predicted)\n    print(f\"Classification Reprot:\\n\\n{class_report}\")","metadata":{"id":"xcrcxa_4nUhX","execution":{"iopub.status.busy":"2022-08-09T10:57:17.865495Z","iopub.execute_input":"2022-08-09T10:57:17.865829Z","iopub.status.idle":"2022-08-09T10:57:17.877813Z","shell.execute_reply.started":"2022-08-09T10:57:17.865801Z","shell.execute_reply":"2022-08-09T10:57:17.876656Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# Loading the sample submission file\nsample_submission = pd.read_csv(\"../input/tabular-playground-series-aug-2022/sample_submission.csv\")\n\ndef generate_submission(model, preds):\n    sub_df = pd.DataFrame()\n    sub_df[\"id\"] = sample_submission[\"id\"]\n    sub_df[\"faliure\"] = preds\n    sub_df.to_csv(f\"submission-{model.__class__.__name__}.csv\", index=False)","metadata":{"id":"W-oOJOtjobLw","execution":{"iopub.status.busy":"2022-08-09T10:57:17.879213Z","iopub.execute_input":"2022-08-09T10:57:17.879538Z","iopub.status.idle":"2022-08-09T10:57:17.908948Z","shell.execute_reply.started":"2022-08-09T10:57:17.879508Z","shell.execute_reply":"2022-08-09T10:57:17.907673Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"## AutoGluon - Open Source AutoML library from Amazon\nAutoGluon - https://auto.gluon.ai/stable/index.html","metadata":{"id":"OU_rzyxIpCkv"}},{"cell_type":"code","source":"# Install Required Packages\n!python3 -m pip install -q \"mxnet<2.0.0\"\n!python3 -m pip install -q autogluon\n!python3 -m pip install -q -U graphviz\n!python3 -m pip install -q -U scikit-learn\n!python3 -m pip install -q pandas --upgrade\n!pip install awscli -q --upgrade","metadata":{"id":"-vnkdtyNpA5Z","outputId":"6485b4ca-cf49-42a5-8a09-6d9a7f448e9e","execution":{"iopub.status.busy":"2022-08-09T10:57:17.913994Z","iopub.execute_input":"2022-08-09T10:57:17.914395Z","iopub.status.idle":"2022-08-09T10:59:33.705944Z","shell.execute_reply.started":"2022-08-09T10:57:17.914362Z","shell.execute_reply":"2022-08-09T10:59:33.704394Z"},"collapsed":true,"jupyter":{"outputs_hidden":true},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# AutoGluon imports\nfrom autogluon.tabular import TabularPredictor\nfrom autogluon.core.metrics import make_scorer","metadata":{"id":"FkGVgHGOpENa","execution":{"iopub.status.busy":"2022-08-09T10:59:33.707904Z","iopub.execute_input":"2022-08-09T10:59:33.708407Z","iopub.status.idle":"2022-08-09T10:59:34.207152Z","shell.execute_reply.started":"2022-08-09T10:59:33.708365Z","shell.execute_reply":"2022-08-09T10:59:34.205888Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# Joining training - features and target\nnew_train = pd.concat([X_train, y_train], axis=1)","metadata":{"id":"TtzfbR1kpK6Q","execution":{"iopub.status.busy":"2022-08-09T10:59:34.209889Z","iopub.execute_input":"2022-08-09T10:59:34.210281Z","iopub.status.idle":"2022-08-09T10:59:34.219847Z","shell.execute_reply.started":"2022-08-09T10:59:34.210249Z","shell.execute_reply":"2022-08-09T10:59:34.218610Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# Creating a custom scorer for AutoGluon\nag_accuracy_scorer = make_scorer(\n    name='accuracy',\n    score_func=metrics.accuracy_score,\n    optimum=1,\n    greater_is_better=True\n)","metadata":{"id":"7ODimETupam8","execution":{"iopub.status.busy":"2022-08-09T10:59:34.221336Z","iopub.execute_input":"2022-08-09T10:59:34.221686Z","iopub.status.idle":"2022-08-09T10:59:34.229727Z","shell.execute_reply.started":"2022-08-09T10:59:34.221655Z","shell.execute_reply":"2022-08-09T10:59:34.228648Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# Initialize the TabularPredictor Model\nmodel_autogluon = TabularPredictor(label='failure', eval_metric=ag_accuracy_scorer)\n\n# Train the Model\nmodel_autogluon.fit(train_data=train, time_limit=MAX_MODEL_RUNTIME_SECS)","metadata":{"id":"DAJl6_RXpj_Z","outputId":"281d7e35-78e2-4c7e-9870-49bccfbef9fb","execution":{"iopub.status.busy":"2022-08-09T10:59:34.231118Z","iopub.execute_input":"2022-08-09T10:59:34.231434Z","iopub.status.idle":"2022-08-09T11:01:22.637061Z","shell.execute_reply.started":"2022-08-09T10:59:34.231405Z","shell.execute_reply":"2022-08-09T11:01:22.635322Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# Check Leaderboard\nmodel_autogluon.leaderboard()","metadata":{"id":"VvuMZsYaprCF","outputId":"d02be2cf-1e00-49f9-a21f-6c5949690453","execution":{"iopub.status.busy":"2022-08-09T11:01:22.639592Z","iopub.execute_input":"2022-08-09T11:01:22.640662Z","iopub.status.idle":"2022-08-09T11:01:22.680659Z","shell.execute_reply.started":"2022-08-09T11:01:22.640595Z","shell.execute_reply":"2022-08-09T11:01:22.678729Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# Get the predictions on testing data\ny_pred =  model_autogluon.predict(X_test)\n\n# Get scores\nget_scores(y_test, y_pred)","metadata":{"id":"pJAlMQ7xpssE","outputId":"1c565a0e-363d-4233-eaba-0a7d41d03ecf","execution":{"iopub.status.busy":"2022-08-09T11:01:22.682878Z","iopub.execute_input":"2022-08-09T11:01:22.683298Z","iopub.status.idle":"2022-08-09T11:01:23.017497Z","shell.execute_reply.started":"2022-08-09T11:01:22.683259Z","shell.execute_reply":"2022-08-09T11:01:23.016369Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# Predictions for submission file\npreds = model_autogluon.predict(test)\n\n# Generate submission file\ngenerate_submission(model_autogluon, preds)","metadata":{"id":"Yeq2zBX4puxv","execution":{"iopub.status.busy":"2022-08-09T11:01:23.018730Z","iopub.execute_input":"2022-08-09T11:01:23.019058Z","iopub.status.idle":"2022-08-09T11:01:23.156349Z","shell.execute_reply.started":"2022-08-09T11:01:23.019028Z","shell.execute_reply":"2022-08-09T11:01:23.155041Z"},"trusted":true},"execution_count":null,"outputs":[]}]}