{"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)\nimport gc\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":"2021-12-09T17:44:56.937628Z","iopub.execute_input":"2021-12-09T17:44:56.938626Z","iopub.status.idle":"2021-12-09T17:44:56.950417Z","shell.execute_reply.started":"2021-12-09T17:44:56.938565Z","shell.execute_reply":"2021-12-09T17:44:56.949564Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"!pwd","metadata":{"execution":{"iopub.status.busy":"2021-12-09T17:44:56.953306Z","iopub.execute_input":"2021-12-09T17:44:56.953658Z","iopub.status.idle":"2021-12-09T17:44:57.694354Z","shell.execute_reply.started":"2021-12-09T17:44:56.953619Z","shell.execute_reply":"2021-12-09T17:44:57.692671Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"#### Extract the zip files","metadata":{}},{"cell_type":"code","source":"import zipfile\n\nwith zipfile.ZipFile('../input/dogs-vs-cats-redux-kernels-edition/test.zip','r') as z:\n    z.extractall('.')\n    \nwith zipfile.ZipFile('../input/dogs-vs-cats-redux-kernels-edition/train.zip','r') as z:\n    z.extractall('.')","metadata":{"execution":{"iopub.status.busy":"2021-12-09T17:44:57.696445Z","iopub.execute_input":"2021-12-09T17:44:57.697378Z","iopub.status.idle":"2021-12-09T17:45:12.548048Z","shell.execute_reply.started":"2021-12-09T17:44:57.697329Z","shell.execute_reply":"2021-12-09T17:45:12.547218Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"!ls","metadata":{"execution":{"iopub.status.busy":"2021-12-09T17:45:12.551784Z","iopub.execute_input":"2021-12-09T17:45:12.552034Z","iopub.status.idle":"2021-12-09T17:45:13.286338Z","shell.execute_reply.started":"2021-12-09T17:45:12.552006Z","shell.execute_reply":"2021-12-09T17:45:13.285379Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"#### Extract labels, Downsize images and prepare the data","metadata":{}},{"cell_type":"code","source":"import cv2\nfrom random import shuffle\n\nIMG_SIZE = 50\nNUM_TRAIN = 25000\n\nX_Train_orig = []\nY_Train_orig = []\n\nfiles = list(os.listdir('/kaggle/working/train/'))\n\nshuffle(files)\nfiles = files[:NUM_TRAIN]\n\nfor i in files:\n    label = i.split('.')[-3]\n    if label == 'cat':\n        label = 0\n    elif label == 'dog':\n        label = 1\n    img = cv2.imread('/kaggle/working/train/'+i, cv2.IMREAD_COLOR)\n    img = cv2.resize(img,(IMG_SIZE,IMG_SIZE), interpolation=cv2.INTER_CUBIC)\n    X_Train_orig.append([np.array(img)/255, np.array(label)])\n\nnp.save('Training_Data.npy', X_Train_orig)","metadata":{"execution":{"iopub.status.busy":"2021-12-09T17:45:13.290778Z","iopub.execute_input":"2021-12-09T17:45:13.291029Z","iopub.status.idle":"2021-12-09T17:46:12.289152Z","shell.execute_reply.started":"2021-12-09T17:45:13.291000Z","shell.execute_reply":"2021-12-09T17:46:12.288153Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"!ls","metadata":{"execution":{"iopub.status.busy":"2021-12-09T17:46:12.290713Z","iopub.execute_input":"2021-12-09T17:46:12.291005Z","iopub.status.idle":"2021-12-09T17:46:13.111204Z","shell.execute_reply.started":"2021-12-09T17:46:12.290965Z","shell.execute_reply":"2021-12-09T17:46:13.110217Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"X = np.array([i[0] for i in X_Train_orig]).reshape(-1, IMG_SIZE, IMG_SIZE, 3)\nY = np.array([i[1] for i in X_Train_orig])\ndel X_Train_orig\ngc.collect","metadata":{"execution":{"iopub.status.busy":"2021-12-09T17:46:13.114539Z","iopub.execute_input":"2021-12-09T17:46:13.114853Z","iopub.status.idle":"2021-12-09T17:46:14.529433Z","shell.execute_reply.started":"2021-12-09T17:46:13.114804Z","shell.execute_reply":"2021-12-09T17:46:14.528713Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"import seaborn as sns\nsns.countplot(Y).set_title(\"Data Distribution\")","metadata":{"execution":{"iopub.status.busy":"2021-12-09T17:46:14.530726Z","iopub.execute_input":"2021-12-09T17:46:14.531280Z","iopub.status.idle":"2021-12-09T17:46:14.713569Z","shell.execute_reply.started":"2021-12-09T17:46:14.531241Z","shell.execute_reply":"2021-12-09T17:46:14.712771Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"#### Select a subset","metadata":{}},{"cell_type":"code","source":"X.shape","metadata":{"execution":{"iopub.status.busy":"2021-12-09T17:46:14.714784Z","iopub.execute_input":"2021-12-09T17:46:14.715059Z","iopub.status.idle":"2021-12-09T17:46:14.722014Z","shell.execute_reply.started":"2021-12-09T17:46:14.715023Z","shell.execute_reply":"2021-12-09T17:46:14.720976Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"Y.shape","metadata":{"execution":{"iopub.status.busy":"2021-12-09T17:46:14.723930Z","iopub.execute_input":"2021-12-09T17:46:14.724259Z","iopub.status.idle":"2021-12-09T17:46:14.733614Z","shell.execute_reply.started":"2021-12-09T17:46:14.724214Z","shell.execute_reply":"2021-12-09T17:46:14.732631Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"#### Train test split","metadata":{"execution":{"iopub.status.busy":"2021-12-09T10:49:14.536025Z","iopub.execute_input":"2021-12-09T10:49:14.536528Z","iopub.status.idle":"2021-12-09T10:49:14.540552Z","shell.execute_reply.started":"2021-12-09T10:49:14.536477Z","shell.execute_reply":"2021-12-09T10:49:14.539979Z"}}},{"cell_type":"code","source":"from sklearn.model_selection import train_test_split\nX_train, X_val, Y_train, Y_val = train_test_split(X, Y, test_size = 0.2, stratify=Y)\ndel X\ndel Y\ngc.collect","metadata":{"execution":{"iopub.status.busy":"2021-12-09T17:46:14.735503Z","iopub.execute_input":"2021-12-09T17:46:14.735926Z","iopub.status.idle":"2021-12-09T17:46:16.121467Z","shell.execute_reply.started":"2021-12-09T17:46:14.735865Z","shell.execute_reply":"2021-12-09T17:46:16.120578Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"print('Shape of X_train is :', X_train.shape)\nprint('Shape of Y_train is :', Y_train.shape)\nprint('Shape of X_val is :', X_val.shape)\nprint('Shape of Y_val is :', Y_val.shape)","metadata":{"execution":{"iopub.status.busy":"2021-12-09T17:46:16.122926Z","iopub.execute_input":"2021-12-09T17:46:16.123403Z","iopub.status.idle":"2021-12-09T17:46:16.131029Z","shell.execute_reply.started":"2021-12-09T17:46:16.123361Z","shell.execute_reply":"2021-12-09T17:46:16.130249Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"import matplotlib.pyplot as plt \nplt.figure(figsize=(20,20))   # to fix a shape for each image print\nfor i in range(50):          # using a for loop to display a number of images\n    plt.subplot(5, 10, i+1) # we need to use this function to print an array of pictures \n    plt.imshow(X_val[i,:,:,:]) # this will call the images from train set one by one\n    plt.title('DOG' if Y_val[i] == 1 else 'CAT')  # Lets also look into the labels \n    plt.axis('off') ","metadata":{"execution":{"iopub.status.busy":"2021-12-09T17:46:16.132429Z","iopub.execute_input":"2021-12-09T17:46:16.132860Z","iopub.status.idle":"2021-12-09T17:46:19.495091Z","shell.execute_reply.started":"2021-12-09T17:46:16.132824Z","shell.execute_reply":"2021-12-09T17:46:19.493502Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"#### Model Evaluation","metadata":{}},{"cell_type":"markdown","source":"#### Model 1","metadata":{"execution":{"iopub.status.busy":"2021-12-09T11:23:30.688256Z","iopub.execute_input":"2021-12-09T11:23:30.689048Z","iopub.status.idle":"2021-12-09T11:23:30.694901Z","shell.execute_reply.started":"2021-12-09T11:23:30.689007Z","shell.execute_reply":"2021-12-09T11:23:30.694292Z"}}},{"cell_type":"code","source":"from tensorflow import keras\nfrom tensorflow.keras import layers\nfrom tensorflow.keras import models\n\ninput_shape=X_train.shape[1:4]\n\nmodel = models.Sequential()\n\nmodel.add(layers.Conv2D(32, (3, 3), input_shape=input_shape))\nmodel.add(layers.Activation('relu'))\nmodel.add(layers.BatchNormalization(axis = 3))\nmodel.add(layers.MaxPooling2D(pool_size=(2, 2)))\n\nmodel.add(layers.Conv2D(64, (3, 3)))\nmodel.add(layers.Activation('relu'))\nmodel.add(layers.BatchNormalization(axis = 3))\nmodel.add(layers.MaxPooling2D(pool_size=(2, 2)))\n\nmodel.add(layers.Flatten())\nmodel.add(layers.Dense(1024))\nmodel.add(layers.Activation('relu'))\nmodel.add(layers.BatchNormalization())\nmodel.add(layers.Dropout(0.5))\n\nmodel.add(layers.Dense(1))\nmodel.add(layers.Activation('sigmoid'))","metadata":{"execution":{"iopub.status.busy":"2021-12-09T17:49:05.816669Z","iopub.execute_input":"2021-12-09T17:49:05.817506Z","iopub.status.idle":"2021-12-09T17:49:06.012050Z","shell.execute_reply.started":"2021-12-09T17:49:05.817452Z","shell.execute_reply":"2021-12-09T17:49:06.011212Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"from tensorflow.keras.optimizers import Adam\n\nepochs = 200\nbatch_size = 16\nlrate = 0.0001\ndecay = lrate/epochs\noptimizer = Adam(learning_rate=lrate, epsilon=1e-08, decay = decay)","metadata":{"execution":{"iopub.status.busy":"2021-12-09T17:49:08.797141Z","iopub.execute_input":"2021-12-09T17:49:08.797766Z","iopub.status.idle":"2021-12-09T17:49:08.803134Z","shell.execute_reply.started":"2021-12-09T17:49:08.797728Z","shell.execute_reply":"2021-12-09T17:49:08.802274Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"from tensorflow.keras.optimizers import RMSprop\nmodel.compile(loss='binary_crossentropy',\n              optimizer=optimizer, #'rmsprop',\n              metrics=['accuracy'])\n\nmodel.summary()","metadata":{"execution":{"iopub.status.busy":"2021-12-09T17:49:09.932850Z","iopub.execute_input":"2021-12-09T17:49:09.933532Z","iopub.status.idle":"2021-12-09T17:49:09.955563Z","shell.execute_reply.started":"2021-12-09T17:49:09.933487Z","shell.execute_reply":"2021-12-09T17:49:09.954750Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"#### Model Training","metadata":{}},{"cell_type":"markdown","source":"#### Callbacks","metadata":{}},{"cell_type":"code","source":"from keras.callbacks import ReduceLROnPlateau\nlearning_rate_reduction = ReduceLROnPlateau(monitor='val_acc', patience=2, \n                                            verbose=1, factor=0.5, min_lr=0.0000001)","metadata":{"execution":{"iopub.status.busy":"2021-12-09T17:49:14.664999Z","iopub.execute_input":"2021-12-09T17:49:14.665553Z","iopub.status.idle":"2021-12-09T17:49:14.670466Z","shell.execute_reply.started":"2021-12-09T17:49:14.665513Z","shell.execute_reply":"2021-12-09T17:49:14.669772Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"from keras.callbacks import ModelCheckpoint, Callback, EarlyStopping\nearly_stopping = EarlyStopping(monitor='val_loss', patience=10, verbose=1, mode='auto')","metadata":{"execution":{"iopub.status.busy":"2021-12-09T17:49:15.492296Z","iopub.execute_input":"2021-12-09T17:49:15.493285Z","iopub.status.idle":"2021-12-09T17:49:15.499085Z","shell.execute_reply.started":"2021-12-09T17:49:15.493246Z","shell.execute_reply":"2021-12-09T17:49:15.498198Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"history = model.fit(x = X_train, y = Y_train, batch_size = batch_size, \n                        epochs=epochs, verbose=1, \n                        validation_data = (X_val, Y_val),\n                          shuffle = True, \n                          steps_per_epoch= len(X_train)//batch_size, validation_steps=len(X_val)//batch_size,\n                        callbacks=[learning_rate_reduction, early_stopping] )","metadata":{"execution":{"iopub.status.busy":"2021-12-09T17:49:16.380611Z","iopub.execute_input":"2021-12-09T17:49:16.381369Z","iopub.status.idle":"2021-12-09T17:50:55.586752Z","shell.execute_reply.started":"2021-12-09T17:49:16.381330Z","shell.execute_reply":"2021-12-09T17:50:55.585922Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"gc.collect\npreds = model.evaluate(X_train, Y_train)\nprint (\"Loss = \" + str(preds[0]))\nprint (\"Training set Accuracy = \" + str(preds[1]))","metadata":{"execution":{"iopub.status.busy":"2021-12-09T17:50:55.588647Z","iopub.execute_input":"2021-12-09T17:50:55.590047Z","iopub.status.idle":"2021-12-09T17:51:42.864353Z","shell.execute_reply.started":"2021-12-09T17:50:55.590005Z","shell.execute_reply":"2021-12-09T17:51:42.863009Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"preds_val = model.evaluate(X_val, Y_val)\nprint (\"Loss = \" + str(preds_val[0]))\nprint (\"Validation Set Accuracy = \" + str(preds_val[1]))","metadata":{"execution":{"iopub.status.busy":"2021-12-09T17:51:42.865926Z","iopub.execute_input":"2021-12-09T17:51:42.866182Z","iopub.status.idle":"2021-12-09T17:51:43.687263Z","shell.execute_reply.started":"2021-12-09T17:51:42.866147Z","shell.execute_reply":"2021-12-09T17:51:43.686516Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"y_prob = model.predict(X_val)","metadata":{"execution":{"iopub.status.busy":"2021-12-09T17:51:43.689394Z","iopub.execute_input":"2021-12-09T17:51:43.689654Z","iopub.status.idle":"2021-12-09T17:51:44.357227Z","shell.execute_reply.started":"2021-12-09T17:51:43.689619Z","shell.execute_reply":"2021-12-09T17:51:44.356405Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"#### Confusion Matrix","metadata":{}},{"cell_type":"code","source":"# Goodness of fit helpers\nfrom sklearn import metrics\n\ny_pred = [1 if prob > 0.5 else 0 for prob in y_prob]\n\nmetrics.confusion_matrix(Y_val, y_pred)","metadata":{"execution":{"iopub.status.busy":"2021-12-09T17:51:44.358592Z","iopub.execute_input":"2021-12-09T17:51:44.358859Z","iopub.status.idle":"2021-12-09T17:51:44.388493Z","shell.execute_reply.started":"2021-12-09T17:51:44.358825Z","shell.execute_reply":"2021-12-09T17:51:44.387801Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"#### ROC","metadata":{}},{"cell_type":"code","source":"from sklearn.metrics import roc_curve, roc_auc_score\n\nfpr , tpr , thresholds = roc_curve ( Y_val , y_prob)\n\nprint(f'AUC is {roc_auc_score(Y_val, y_prob)}')","metadata":{"execution":{"iopub.status.busy":"2021-12-09T17:51:44.389708Z","iopub.execute_input":"2021-12-09T17:51:44.389995Z","iopub.status.idle":"2021-12-09T17:51:44.402354Z","shell.execute_reply.started":"2021-12-09T17:51:44.389966Z","shell.execute_reply":"2021-12-09T17:51:44.401539Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"import matplotlib.pyplot as plt\n\ndef plot_roc_curve(fpr,tpr): \n  plt.plot(fpr,tpr) \n  plt.axis([0,1,0,1]) \n  plt.xlabel('False Positive Rate') \n  plt.ylabel('True Positive Rate') \n  plt.show()    \n  \nplot_roc_curve (fpr,tpr) ","metadata":{"execution":{"iopub.status.busy":"2021-12-09T17:51:44.403794Z","iopub.execute_input":"2021-12-09T17:51:44.404137Z","iopub.status.idle":"2021-12-09T17:51:44.615501Z","shell.execute_reply.started":"2021-12-09T17:51:44.404101Z","shell.execute_reply":"2021-12-09T17:51:44.614773Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"#### Precision-Recall Curves","metadata":{}},{"cell_type":"code","source":"from sklearn.metrics import precision_recall_curve\n\nprecision, recall, thresholds = precision_recall_curve(Y_val, y_prob)\n\nimport matplotlib.pyplot as plt\n\ndef plot_pr_curve(recall,precision): \n  plt.plot(recall, precision) \n  plt.axis([0,1,0,1]) \n  plt.xlabel('Recall') \n  plt.ylabel('Precision') \n  plt.show()   \n  \nplot_pr_curve (recall, precision) ","metadata":{"execution":{"iopub.status.busy":"2021-12-09T17:51:44.616735Z","iopub.execute_input":"2021-12-09T17:51:44.617547Z","iopub.status.idle":"2021-12-09T17:51:44.792549Z","shell.execute_reply.started":"2021-12-09T17:51:44.617507Z","shell.execute_reply":"2021-12-09T17:51:44.791745Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"del X_train\ndel Y_train\ndel X_val\ndel Y_val\ngc.collect","metadata":{"execution":{"iopub.status.busy":"2021-12-09T17:51:44.793871Z","iopub.execute_input":"2021-12-09T17:51:44.794133Z","iopub.status.idle":"2021-12-09T17:51:44.812187Z","shell.execute_reply.started":"2021-12-09T17:51:44.794097Z","shell.execute_reply":"2021-12-09T17:51:44.811096Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"#### Prepare for Submission","metadata":{}},{"cell_type":"code","source":"X_Test_orig = []\nfor i in os.listdir('/kaggle/working/test/'):\n    label = i.split('.')[-2]\n    img = cv2.imread('/kaggle/working/test/'+i, cv2.IMREAD_COLOR)\n    img = cv2.resize(img,(IMG_SIZE,IMG_SIZE), interpolation = cv2.INTER_CUBIC)\n    X_Test_orig.append([np.array(img)/255, np.array(label)])\n\nnp.save('Test_Data.npy', X_Test_orig)\n\nX_test = np.array([i[0] for i in X_Test_orig]).reshape(-1,IMG_SIZE, IMG_SIZE, 3)\nLabel = np.array([i[1] for i in X_Test_orig])","metadata":{"execution":{"iopub.status.busy":"2021-12-09T17:51:44.815572Z","iopub.execute_input":"2021-12-09T17:51:44.816106Z","iopub.status.idle":"2021-12-09T17:52:15.229020Z","shell.execute_reply.started":"2021-12-09T17:51:44.816075Z","shell.execute_reply":"2021-12-09T17:52:15.228079Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"probs = model.predict(X_test, batch_size = batch_size)","metadata":{"execution":{"iopub.status.busy":"2021-12-09T17:52:15.232601Z","iopub.execute_input":"2021-12-09T17:52:15.232852Z","iopub.status.idle":"2021-12-09T17:52:17.011071Z","shell.execute_reply.started":"2021-12-09T17:52:15.232821Z","shell.execute_reply":"2021-12-09T17:52:17.010201Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"prediction = pd.DataFrame()\nprediction['id'] = Label\nprediction['label'] = probs\n\nprediction.to_csv('submission-1.csv', index = False)","metadata":{"execution":{"iopub.status.busy":"2021-12-09T17:52:17.013544Z","iopub.execute_input":"2021-12-09T17:52:17.013772Z","iopub.status.idle":"2021-12-09T17:52:17.062797Z","shell.execute_reply.started":"2021-12-09T17:52:17.013745Z","shell.execute_reply":"2021-12-09T17:52:17.061966Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"#### Results","metadata":{}},{"cell_type":"code","source":"import matplotlib.pyplot as plt \nplt.figure(figsize=(20,20))   # to fix a shape for each image print\nfor i in range(50):          # using a for loop to display a number of images\n    plt.subplot(5, 10, i+1) # we need to use this function to print an array of pictures \n    plt.imshow(X_test[i,:,:,:]) # this will call the images from train set one by one\n    plt.title('DOG' if probs[i] > 0.5 else 'CAT')  # Lets also look into the labels \n    plt.axis('off') ","metadata":{"execution":{"iopub.status.busy":"2021-12-09T17:52:17.064065Z","iopub.execute_input":"2021-12-09T17:52:17.064937Z","iopub.status.idle":"2021-12-09T17:52:20.500218Z","shell.execute_reply.started":"2021-12-09T17:52:17.064875Z","shell.execute_reply":"2021-12-09T17:52:20.499511Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"#del X_test\n#del prediction\n#gc.collect","metadata":{"execution":{"iopub.status.busy":"2021-12-09T17:46:20.159649Z","iopub.status.idle":"2021-12-09T17:46:20.160402Z","shell.execute_reply.started":"2021-12-09T17:46:20.160126Z","shell.execute_reply":"2021-12-09T17:46:20.160154Z"},"trusted":true},"execution_count":null,"outputs":[]}]}