{"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-08-08T18:30:39.703425Z","iopub.execute_input":"2022-08-08T18:30:39.703804Z","iopub.status.idle":"2022-08-08T18:30:39.714009Z","shell.execute_reply.started":"2022-08-08T18:30:39.703769Z","shell.execute_reply":"2022-08-08T18:30:39.712696Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train_df = pd.read_csv(\"/kaggle/input/tabular-playground-series-aug-2022/train.csv\")\ntest_df = pd.read_csv(\"/kaggle/input/tabular-playground-series-aug-2022/test.csv\")\nsample_submission_df = pd.read_csv(\"/kaggle/input/tabular-playground-series-aug-2022/sample_submission.csv\")","metadata":{"execution":{"iopub.status.busy":"2022-08-08T18:30:39.717464Z","iopub.execute_input":"2022-08-08T18:30:39.718172Z","iopub.status.idle":"2022-08-08T18:30:39.892259Z","shell.execute_reply.started":"2022-08-08T18:30:39.718136Z","shell.execute_reply":"2022-08-08T18:30:39.891119Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"## Initial Analysis","metadata":{}},{"cell_type":"code","source":"print(f\"Train shape: {train_df.shape}\")\nprint(f\"Test shape: {test_df.shape}\")","metadata":{"execution":{"iopub.status.busy":"2022-08-08T18:30:39.894486Z","iopub.execute_input":"2022-08-08T18:30:39.894832Z","iopub.status.idle":"2022-08-08T18:30:39.900147Z","shell.execute_reply.started":"2022-08-08T18:30:39.894802Z","shell.execute_reply":"2022-08-08T18:30:39.899020Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train_df.head()","metadata":{"execution":{"iopub.status.busy":"2022-08-08T18:30:39.901581Z","iopub.execute_input":"2022-08-08T18:30:39.901906Z","iopub.status.idle":"2022-08-08T18:30:39.938467Z","shell.execute_reply.started":"2022-08-08T18:30:39.901877Z","shell.execute_reply":"2022-08-08T18:30:39.937684Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"test_df.head()","metadata":{"execution":{"iopub.status.busy":"2022-08-08T18:30:39.940048Z","iopub.execute_input":"2022-08-08T18:30:39.940387Z","iopub.status.idle":"2022-08-08T18:30:39.969742Z","shell.execute_reply.started":"2022-08-08T18:30:39.940359Z","shell.execute_reply":"2022-08-08T18:30:39.968762Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train_df.describe(include=[\"object\"])","metadata":{"execution":{"iopub.status.busy":"2022-08-08T18:30:39.970981Z","iopub.execute_input":"2022-08-08T18:30:39.971317Z","iopub.status.idle":"2022-08-08T18:30:39.997545Z","shell.execute_reply.started":"2022-08-08T18:30:39.971289Z","shell.execute_reply":"2022-08-08T18:30:39.996419Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train_df.describe(exclude=[\"object\"])","metadata":{"execution":{"iopub.status.busy":"2022-08-08T18:30:39.999017Z","iopub.execute_input":"2022-08-08T18:30:39.999320Z","iopub.status.idle":"2022-08-08T18:30:40.102853Z","shell.execute_reply.started":"2022-08-08T18:30:39.999292Z","shell.execute_reply":"2022-08-08T18:30:40.101682Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train_df.isna().sum()","metadata":{"execution":{"iopub.status.busy":"2022-08-08T18:30:40.104494Z","iopub.execute_input":"2022-08-08T18:30:40.104950Z","iopub.status.idle":"2022-08-08T18:30:40.120526Z","shell.execute_reply.started":"2022-08-08T18:30:40.104909Z","shell.execute_reply":"2022-08-08T18:30:40.119521Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"test_df.isna().sum()","metadata":{"execution":{"iopub.status.busy":"2022-08-08T18:30:40.121748Z","iopub.execute_input":"2022-08-08T18:30:40.122038Z","iopub.status.idle":"2022-08-08T18:30:40.136248Z","shell.execute_reply.started":"2022-08-08T18:30:40.122011Z","shell.execute_reply":"2022-08-08T18:30:40.135040Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"## Feature Analysis","metadata":{}},{"cell_type":"code","source":"import matplotlib.pyplot as plt\nimport seaborn as sns","metadata":{"execution":{"iopub.status.busy":"2022-08-08T18:30:40.137333Z","iopub.execute_input":"2022-08-08T18:30:40.137771Z","iopub.status.idle":"2022-08-08T18:30:40.143023Z","shell.execute_reply.started":"2022-08-08T18:30:40.137739Z","shell.execute_reply":"2022-08-08T18:30:40.141948Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"ax = sns.countplot(x=train_df[\"failure\"])\nax.set_title(\"Label Count Plot\")\nsns.despine(bottom=True)","metadata":{"execution":{"iopub.status.busy":"2022-08-08T18:30:40.150054Z","iopub.execute_input":"2022-08-08T18:30:40.150439Z","iopub.status.idle":"2022-08-08T18:30:40.268043Z","shell.execute_reply.started":"2022-08-08T18:30:40.150391Z","shell.execute_reply":"2022-08-08T18:30:40.266562Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"### Numeric Features","metadata":{}},{"cell_type":"code","source":"n_rows=5\nn_cols=5\n# Create the subplots\nfig, axes = plt.subplots(nrows=n_rows, ncols=n_cols, figsize=(20,20))\nnumerics = ['int16', 'int32', 'int64', 'float16', 'float32', 'float64']\n\nfor i, column in enumerate(train_df.select_dtypes(include=numerics).columns):\n    sns.histplot(train_df[column],ax=axes[i//n_cols,i%n_cols])","metadata":{"execution":{"iopub.status.busy":"2022-08-08T18:30:40.270359Z","iopub.execute_input":"2022-08-08T18:30:40.270943Z","iopub.status.idle":"2022-08-08T18:30:47.186872Z","shell.execute_reply.started":"2022-08-08T18:30:40.270887Z","shell.execute_reply":"2022-08-08T18:30:47.185697Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"n_rows=5\nn_cols=5\n# Create the subplots\nfig, axes = plt.subplots(nrows=n_rows, ncols=n_cols, figsize=(20,20))\nnumerics = ['int16', 'int32', 'int64', 'float16', 'float32', 'float64']\n\nfor i, column in enumerate(train_df.select_dtypes(include=numerics).columns):\n    sns.histplot(x=column, data=train_df,ax=axes[i//n_cols,i%n_cols], hue=\"failure\", common_norm=False, multiple=\"layer\", stat=\"density\", kde=True)","metadata":{"execution":{"iopub.status.busy":"2022-08-08T18:30:47.188251Z","iopub.execute_input":"2022-08-08T18:30:47.188573Z","iopub.status.idle":"2022-08-08T18:31:03.206192Z","shell.execute_reply.started":"2022-08-08T18:30:47.188543Z","shell.execute_reply":"2022-08-08T18:31:03.205014Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"n_rows=1\nn_cols=3\n# Create the subplots\nfig, axes = plt.subplots(nrows=n_rows, ncols=n_cols, figsize=(20,5))\n\nfor i, column in enumerate(train_df.select_dtypes(include=\"object\").columns):\n    sns.histplot(x=train_df[column],ax=axes[i%n_cols])","metadata":{"execution":{"iopub.status.busy":"2022-08-08T18:31:03.208022Z","iopub.execute_input":"2022-08-08T18:31:03.208361Z","iopub.status.idle":"2022-08-08T18:31:03.688871Z","shell.execute_reply.started":"2022-08-08T18:31:03.208331Z","shell.execute_reply":"2022-08-08T18:31:03.687823Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"n_rows=1\nn_cols=3\n# Create the subplots\nfig, axes = plt.subplots(nrows=n_rows, ncols=n_cols, figsize=(20,5))\n\nfor i, column in enumerate(train_df.select_dtypes(include=\"object\").columns):\n    sns.histplot(x=column, data=train_df,ax=axes[i%n_cols], hue=\"failure\", common_norm=False, multiple=\"dodge\", stat=\"density\")","metadata":{"execution":{"iopub.status.busy":"2022-08-08T18:31:03.690494Z","iopub.execute_input":"2022-08-08T18:31:03.690852Z","iopub.status.idle":"2022-08-08T18:31:04.328480Z","shell.execute_reply.started":"2022-08-08T18:31:03.690819Z","shell.execute_reply":"2022-08-08T18:31:04.327308Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"for col in clean_train_df.select_dtypes(include=\"object\").columns:\n    print(col)\n    print(clean_train_df[col].unique())","metadata":{"execution":{"iopub.status.busy":"2022-08-08T18:31:04.329847Z","iopub.execute_input":"2022-08-08T18:31:04.330935Z","iopub.status.idle":"2022-08-08T18:31:04.339331Z","shell.execute_reply.started":"2022-08-08T18:31:04.330889Z","shell.execute_reply":"2022-08-08T18:31:04.338360Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"for col in clean_test_df.select_dtypes(include=\"object\").columns:\n    print(col)\n    print(clean_test_df[col].unique())","metadata":{"execution":{"iopub.status.busy":"2022-08-08T18:31:04.340547Z","iopub.execute_input":"2022-08-08T18:31:04.340937Z","iopub.status.idle":"2022-08-08T18:31:04.352907Z","shell.execute_reply.started":"2022-08-08T18:31:04.340905Z","shell.execute_reply":"2022-08-08T18:31:04.351713Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"**!! product_code differs in train/test sets.**","metadata":{}},{"cell_type":"markdown","source":"## Basic Cleaning","metadata":{}},{"cell_type":"code","source":"clean_train_df = train_df.copy(deep=True)\nclean_test_df = test_df.copy(deep=True)","metadata":{"execution":{"iopub.status.busy":"2022-08-08T18:34:33.006925Z","iopub.execute_input":"2022-08-08T18:34:33.007536Z","iopub.status.idle":"2022-08-08T18:34:33.018804Z","shell.execute_reply.started":"2022-08-08T18:34:33.007500Z","shell.execute_reply":"2022-08-08T18:34:33.017742Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"clean_train_df.set_index(\"id\", drop=True, inplace=True)\nclean_test_df.set_index(\"id\", drop=True, inplace=True)","metadata":{"execution":{"iopub.status.busy":"2022-08-08T18:34:33.168196Z","iopub.execute_input":"2022-08-08T18:34:33.169555Z","iopub.status.idle":"2022-08-08T18:34:33.176052Z","shell.execute_reply.started":"2022-08-08T18:34:33.169510Z","shell.execute_reply":"2022-08-08T18:34:33.175066Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"clean_test_df","metadata":{"execution":{"iopub.status.busy":"2022-08-08T18:34:33.559884Z","iopub.execute_input":"2022-08-08T18:34:33.560573Z","iopub.status.idle":"2022-08-08T18:34:33.603800Z","shell.execute_reply.started":"2022-08-08T18:34:33.560535Z","shell.execute_reply":"2022-08-08T18:34:33.602584Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"### Drop Some Columns","metadata":{}},{"cell_type":"code","source":"clean_train_df.drop(columns=[\"product_code\"], inplace=True)\nclean_test_df.drop(columns=[\"product_code\"], inplace=True)","metadata":{"execution":{"iopub.status.busy":"2022-08-08T18:34:33.963469Z","iopub.execute_input":"2022-08-08T18:34:33.964357Z","iopub.status.idle":"2022-08-08T18:34:33.988808Z","shell.execute_reply.started":"2022-08-08T18:34:33.964303Z","shell.execute_reply":"2022-08-08T18:34:33.987771Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"## Fill null values","metadata":{}},{"cell_type":"code","source":"o_modes = clean_train_df[[\"attribute_0\", \"attribute_1\"]].mode().iloc[0]\nclean_train_df[[\"attribute_0\", \"attribute_1\"]] = clean_train_df[[\"attribute_0\", \"attribute_1\"]].fillna(o_modes)\nclean_train_df = clean_train_df.fillna(method=\"ffill\", axis=0)","metadata":{"execution":{"iopub.status.busy":"2022-08-08T18:34:34.352891Z","iopub.execute_input":"2022-08-08T18:34:34.353795Z","iopub.status.idle":"2022-08-08T18:34:34.381311Z","shell.execute_reply.started":"2022-08-08T18:34:34.353750Z","shell.execute_reply":"2022-08-08T18:34:34.380446Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"o_modes = clean_test_df[[\"attribute_0\", \"attribute_1\"]].mode().iloc[0]\nclean_test_df[[\"attribute_0\", \"attribute_1\"]] = clean_test_df[[\"attribute_0\", \"attribute_1\"]].fillna(o_modes)\nclean_test_df = clean_test_df.fillna(method=\"ffill\", axis=0)","metadata":{"execution":{"iopub.status.busy":"2022-08-08T18:34:34.545016Z","iopub.execute_input":"2022-08-08T18:34:34.545649Z","iopub.status.idle":"2022-08-08T18:34:34.566513Z","shell.execute_reply.started":"2022-08-08T18:34:34.545600Z","shell.execute_reply":"2022-08-08T18:34:34.565684Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"clean_train_df.isna().sum()","metadata":{"execution":{"iopub.status.busy":"2022-08-08T18:34:34.660376Z","iopub.execute_input":"2022-08-08T18:34:34.661046Z","iopub.status.idle":"2022-08-08T18:34:34.674459Z","shell.execute_reply.started":"2022-08-08T18:34:34.661009Z","shell.execute_reply":"2022-08-08T18:34:34.673690Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"clean_test_df.isna().sum()","metadata":{"execution":{"iopub.status.busy":"2022-08-08T18:34:34.772529Z","iopub.execute_input":"2022-08-08T18:34:34.772951Z","iopub.status.idle":"2022-08-08T18:34:34.785575Z","shell.execute_reply.started":"2022-08-08T18:34:34.772918Z","shell.execute_reply":"2022-08-08T18:34:34.784150Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"### Label Encoding","metadata":{}},{"cell_type":"code","source":"for col in clean_train_df.select_dtypes(include=\"object\").columns:\n    print(col)\n    print(clean_train_df[col].unique())","metadata":{"execution":{"iopub.status.busy":"2022-08-08T18:34:35.183382Z","iopub.execute_input":"2022-08-08T18:34:35.183837Z","iopub.status.idle":"2022-08-08T18:34:35.199900Z","shell.execute_reply.started":"2022-08-08T18:34:35.183800Z","shell.execute_reply":"2022-08-08T18:34:35.198657Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"for col in clean_test_df.select_dtypes(include=\"object\").columns:\n    print(col)\n    print(clean_test_df[col].unique())","metadata":{"execution":{"iopub.status.busy":"2022-08-08T18:34:35.396565Z","iopub.execute_input":"2022-08-08T18:34:35.397222Z","iopub.status.idle":"2022-08-08T18:34:35.411031Z","shell.execute_reply.started":"2022-08-08T18:34:35.397176Z","shell.execute_reply":"2022-08-08T18:34:35.409700Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"le_attribute_0 = {\n    \"material_5\": 0,\n    \"material_7\": 1\n}\n\nle_attribute_1 = {\n    \"material_5\": 0,\n    \"material_6\": 1,\n    \"material_7\": 2,\n    \"material_8\": 3\n}","metadata":{"execution":{"iopub.status.busy":"2022-08-08T18:34:35.709507Z","iopub.execute_input":"2022-08-08T18:34:35.709938Z","iopub.status.idle":"2022-08-08T18:34:35.715568Z","shell.execute_reply.started":"2022-08-08T18:34:35.709901Z","shell.execute_reply":"2022-08-08T18:34:35.714393Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"clean_train_df[\"attribute_0\"] = clean_train_df[\"attribute_0\"].map(le_attribute_0)\nclean_test_df[\"attribute_0\"] = clean_test_df[\"attribute_0\"].map(le_attribute_0)\n\nclean_train_df[\"attribute_1\"] = clean_train_df[\"attribute_1\"].map(le_attribute_1)\nclean_test_df[\"attribute_1\"] = clean_test_df[\"attribute_1\"].map(le_attribute_1)","metadata":{"execution":{"iopub.status.busy":"2022-08-08T18:34:35.878657Z","iopub.execute_input":"2022-08-08T18:34:35.879749Z","iopub.status.idle":"2022-08-08T18:34:35.899766Z","shell.execute_reply.started":"2022-08-08T18:34:35.879695Z","shell.execute_reply":"2022-08-08T18:34:35.898906Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"clean_train_df.head()","metadata":{"execution":{"iopub.status.busy":"2022-08-08T18:34:36.061775Z","iopub.execute_input":"2022-08-08T18:34:36.062515Z","iopub.status.idle":"2022-08-08T18:34:36.090661Z","shell.execute_reply.started":"2022-08-08T18:34:36.062478Z","shell.execute_reply":"2022-08-08T18:34:36.089539Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df_corr = clean_train_df.corr()","metadata":{"execution":{"iopub.status.busy":"2022-08-08T18:36:41.639898Z","iopub.execute_input":"2022-08-08T18:36:41.640593Z","iopub.status.idle":"2022-08-08T18:36:41.699662Z","shell.execute_reply.started":"2022-08-08T18:36:41.640557Z","shell.execute_reply":"2022-08-08T18:36:41.698543Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"fig, ax = plt.subplots(figsize=(15, 7))\n# mask\nmask = np.triu(np.ones_like(df_corr, dtype=bool))\n# adjust mask and df\nmask = mask[1:, :-1]\ncorr = df_corr.iloc[1:,:-1].copy()\n# plot heatmap\nsns.heatmap(corr, mask=mask, annot=True, fmt=\".2f\", cmap='Blues',\n           vmin=-1, vmax=1, cbar_kws={\"shrink\": .8})\n# yticks\nplt.yticks(rotation=0)\nplt.show()","metadata":{"execution":{"iopub.status.busy":"2022-08-08T18:37:26.545468Z","iopub.execute_input":"2022-08-08T18:37:26.546387Z","iopub.status.idle":"2022-08-08T18:37:28.129038Z","shell.execute_reply.started":"2022-08-08T18:37:26.546344Z","shell.execute_reply":"2022-08-08T18:37:28.127845Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"g = sns.catplot(x=\"attribute_0\", col=\"attribute_1\", col_wrap=4,\n                data=clean_train_df,\n                kind=\"count\", height=4, aspect=.8, hue=\"failure\")","metadata":{"execution":{"iopub.status.busy":"2022-08-08T18:45:01.492033Z","iopub.execute_input":"2022-08-08T18:45:01.492466Z","iopub.status.idle":"2022-08-08T18:45:02.892312Z","shell.execute_reply.started":"2022-08-08T18:45:01.492431Z","shell.execute_reply":"2022-08-08T18:45:02.891247Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"## Basic Training","metadata":{}},{"cell_type":"code","source":"x_train, y_train = clean_train_df.drop(columns=[\"failure\"]), clean_train_df[\"failure\"]","metadata":{"execution":{"iopub.status.busy":"2022-08-08T18:48:33.690140Z","iopub.execute_input":"2022-08-08T18:48:33.690892Z","iopub.status.idle":"2022-08-08T18:48:33.703036Z","shell.execute_reply.started":"2022-08-08T18:48:33.690855Z","shell.execute_reply":"2022-08-08T18:48:33.701847Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"!pip install flaml","metadata":{"execution":{"iopub.status.busy":"2022-08-08T18:46:42.309543Z","iopub.execute_input":"2022-08-08T18:46:42.309978Z","iopub.status.idle":"2022-08-08T18:46:55.416088Z","shell.execute_reply.started":"2022-08-08T18:46:42.309946Z","shell.execute_reply":"2022-08-08T18:46:55.414662Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"from flaml import AutoML\n\nsettings = {\n    \"time_budget\": 600,\n    \"metric\": 'roc_auc',\n    \"task\": 'classification',  # task type\n    \"seed\": 42,    # random seed\n}\n\nautoml = AutoML()\nautoml.fit(x_train, y_train, **settings)","metadata":{"execution":{"iopub.status.busy":"2022-08-08T18:51:55.597575Z","iopub.execute_input":"2022-08-08T18:51:55.598141Z","iopub.status.idle":"2022-08-08T19:01:57.254280Z","shell.execute_reply.started":"2022-08-08T18:51:55.598087Z","shell.execute_reply":"2022-08-08T19:01:57.253414Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"print('Best ML leaner:', automl.best_estimator)\nprint('Best hyperparmeter config:', automl.best_config)\nprint('Best accuracy on validation data: {0:.4g}'.format(1-automl.best_loss))\nprint('Training duration of best run: {0:.4g} s'.format(automl.best_config_train_time))","metadata":{"execution":{"iopub.status.busy":"2022-08-08T19:01:57.255984Z","iopub.execute_input":"2022-08-08T19:01:57.256978Z","iopub.status.idle":"2022-08-08T19:01:57.263934Z","shell.execute_reply.started":"2022-08-08T19:01:57.256941Z","shell.execute_reply":"2022-08-08T19:01:57.262842Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"automl.model.estimator","metadata":{"execution":{"iopub.status.busy":"2022-08-08T19:01:57.265356Z","iopub.execute_input":"2022-08-08T19:01:57.265699Z","iopub.status.idle":"2022-08-08T19:01:57.280639Z","shell.execute_reply.started":"2022-08-08T19:01:57.265647Z","shell.execute_reply":"2022-08-08T19:01:57.279493Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"test_preds = automl.predict_proba(clean_test_df)","metadata":{"execution":{"iopub.status.busy":"2022-08-08T19:01:57.283228Z","iopub.execute_input":"2022-08-08T19:01:57.283559Z","iopub.status.idle":"2022-08-08T19:01:57.373444Z","shell.execute_reply.started":"2022-08-08T19:01:57.283529Z","shell.execute_reply":"2022-08-08T19:01:57.372024Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"sample_submission_df[\"failure\"] = test_preds[:,1]","metadata":{"execution":{"iopub.status.busy":"2022-08-08T19:04:11.562948Z","iopub.execute_input":"2022-08-08T19:04:11.564097Z","iopub.status.idle":"2022-08-08T19:04:11.569843Z","shell.execute_reply.started":"2022-08-08T19:04:11.564057Z","shell.execute_reply":"2022-08-08T19:04:11.568712Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"sample_submission_df.to_csv(\"submission.csv\")","metadata":{"execution":{"iopub.status.busy":"2022-08-08T19:04:37.026489Z","iopub.execute_input":"2022-08-08T19:04:37.026896Z","iopub.status.idle":"2022-08-08T19:04:37.094003Z","shell.execute_reply.started":"2022-08-08T19:04:37.026865Z","shell.execute_reply":"2022-08-08T19:04:37.092894Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]}]}