{"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-02-28T15:35:05.639612Z","iopub.execute_input":"2022-02-28T15:35:05.640269Z","iopub.status.idle":"2022-02-28T15:35:05.665111Z","shell.execute_reply.started":"2022-02-28T15:35:05.640174Z","shell.execute_reply":"2022-02-28T15:35:05.664366Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"import tensorflow as tf \nimport cv2\nimport matplotlib.pyplot as plt \nfrom keras import Sequential\nfrom keras.layers import Conv2D , Dropout, MaxPooling2D  ,Dense \nfrom keras.activations import softmax\nfrom IPython.display import Image\nfrom sklearn.model_selection import train_test_split\nfrom keras import Input\nimport zipfile\nfrom keras.utils.np_utils import to_categorical \nfrom keras.preprocessing.image import ImageDataGenerator\nfrom keras.layers import Flatten","metadata":{"execution":{"iopub.status.busy":"2022-02-28T15:35:10.77195Z","iopub.execute_input":"2022-02-28T15:35:10.772547Z","iopub.status.idle":"2022-02-28T15:35:16.269618Z","shell.execute_reply.started":"2022-02-28T15:35:10.772506Z","shell.execute_reply":"2022-02-28T15:35:16.268886Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"with zipfile.ZipFile(\"/kaggle/input/dogs-vs-cats/train.zip\",\"r\") as zip_ref:\n    zip_ref.extractall(\".\")\nwith zipfile.ZipFile(\"/kaggle/input/dogs-vs-cats/test1.zip\",\"r\") as zip_ref:\n    zip_ref.extractall(\".\")","metadata":{"execution":{"iopub.status.busy":"2022-02-28T15:35:16.27163Z","iopub.execute_input":"2022-02-28T15:35:16.271885Z","iopub.status.idle":"2022-02-28T15:35:33.482443Z","shell.execute_reply.started":"2022-02-28T15:35:16.271848Z","shell.execute_reply":"2022-02-28T15:35:33.481687Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# Extracting Labels","metadata":{}},{"cell_type":"code","source":"y = [0 if i.split('.')[0]=='cat' else 1 for i in os.listdir(\"./train\")]","metadata":{"execution":{"iopub.status.busy":"2022-02-28T15:35:33.483726Z","iopub.execute_input":"2022-02-28T15:35:33.483958Z","iopub.status.idle":"2022-02-28T15:35:33.511118Z","shell.execute_reply.started":"2022-02-28T15:35:33.483926Z","shell.execute_reply":"2022-02-28T15:35:33.510416Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"print(y[0:5],os.listdir(\"./train\")[0:5])","metadata":{"execution":{"iopub.status.busy":"2022-02-28T15:35:33.513588Z","iopub.execute_input":"2022-02-28T15:35:33.514081Z","iopub.status.idle":"2022-02-28T15:35:33.532803Z","shell.execute_reply.started":"2022-02-28T15:35:33.514038Z","shell.execute_reply":"2022-02-28T15:35:33.532108Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"np.unique(y , return_counts=True)","metadata":{"execution":{"iopub.status.busy":"2022-02-28T15:35:33.534047Z","iopub.execute_input":"2022-02-28T15:35:33.534538Z","iopub.status.idle":"2022-02-28T15:35:33.548598Z","shell.execute_reply.started":"2022-02-28T15:35:33.534486Z","shell.execute_reply":"2022-02-28T15:35:33.547841Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"y = to_categorical(y,num_classes=2)","metadata":{"execution":{"iopub.status.busy":"2022-02-28T15:35:33.550012Z","iopub.execute_input":"2022-02-28T15:35:33.550282Z","iopub.status.idle":"2022-02-28T15:35:33.556685Z","shell.execute_reply.started":"2022-02-28T15:35:33.550247Z","shell.execute_reply":"2022-02-28T15:35:33.555914Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# Exploring data","metadata":{}},{"cell_type":"code","source":"plt.figure(figsize=(10,10))\nfor i in range(1,10):\n    ax=plt.subplot(3, 3, i)\n    ax.get_xaxis().set_visible(False)\n    ax.get_yaxis().set_visible(False)\n    img=cv2.imread(\"./train/\"+os.listdir(\"./train\")[i])\n    ax.set_title(y[i])\n    plt.imshow(img)\nprint(img.shape)","metadata":{"execution":{"iopub.status.busy":"2022-02-28T16:01:41.324422Z","iopub.execute_input":"2022-02-28T16:01:41.324699Z","iopub.status.idle":"2022-02-28T16:01:42.434297Z","shell.execute_reply.started":"2022-02-28T16:01:41.32467Z","shell.execute_reply":"2022-02-28T16:01:42.433631Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# Build training set","metadata":{}},{"cell_type":"code","source":"path=\"./train\"\nX=[]\nfor i in os.listdir(path):\n    img_path = os.path.join(path, i)\n    img = cv2.imread(img_path,0)\n    img = cv2.resize(img,(80,80))\n    X.append(img)","metadata":{"execution":{"iopub.status.busy":"2022-02-28T15:35:34.861379Z","iopub.execute_input":"2022-02-28T15:35:34.861654Z","iopub.status.idle":"2022-02-28T15:35:58.021521Z","shell.execute_reply.started":"2022-02-28T15:35:34.86162Z","shell.execute_reply":"2022-02-28T15:35:58.020715Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"plt.figure(figsize=(10,10))\nfor i in range(1,10):\n    ax=plt.subplot(3, 3, i)\n    ax.get_xaxis().set_visible(False)\n    ax.get_yaxis().set_visible(False)\n    #img=cv2.imread(\"./train/\"+os.listdir(\"./train\")[i])\n    img = X[i]\n    ax.set_title(y[i])\n    plt.imshow(img , cmap='gray')\nprint(img.shape)","metadata":{"execution":{"iopub.status.busy":"2022-02-28T16:08:18.294396Z","iopub.execute_input":"2022-02-28T16:08:18.294665Z","iopub.status.idle":"2022-02-28T16:08:18.836442Z","shell.execute_reply.started":"2022-02-28T16:08:18.294634Z","shell.execute_reply":"2022-02-28T16:08:18.835763Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"X= np.array(X)","metadata":{"execution":{"iopub.status.busy":"2022-02-28T15:35:58.613913Z","iopub.execute_input":"2022-02-28T15:35:58.614697Z","iopub.status.idle":"2022-02-28T15:35:58.69042Z","shell.execute_reply.started":"2022-02-28T15:35:58.614657Z","shell.execute_reply":"2022-02-28T15:35:58.689666Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"X_dim= np.expand_dims(X , axis=3)","metadata":{"execution":{"iopub.status.busy":"2022-02-28T15:35:58.691733Z","iopub.execute_input":"2022-02-28T15:35:58.692094Z","iopub.status.idle":"2022-02-28T15:35:58.697123Z","shell.execute_reply.started":"2022-02-28T15:35:58.692056Z","shell.execute_reply":"2022-02-28T15:35:58.696364Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"data_gen = ImageDataGenerator(rescale = 1./255 , validation_split=0.25)","metadata":{"execution":{"iopub.status.busy":"2022-02-28T15:38:23.916479Z","iopub.execute_input":"2022-02-28T15:38:23.916747Z","iopub.status.idle":"2022-02-28T15:38:23.922302Z","shell.execute_reply.started":"2022-02-28T15:38:23.916718Z","shell.execute_reply":"2022-02-28T15:38:23.921427Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"data_gen.fit(X_dim)","metadata":{"execution":{"iopub.status.busy":"2022-02-28T15:38:24.840515Z","iopub.execute_input":"2022-02-28T15:38:24.841128Z","iopub.status.idle":"2022-02-28T15:38:25.295236Z","shell.execute_reply.started":"2022-02-28T15:38:24.841096Z","shell.execute_reply":"2022-02-28T15:38:25.294456Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# Model Arc","metadata":{}},{"cell_type":"code","source":"def model_gen():\n    model=tf.keras.Sequential()\n    ################################### FEATURE EXTRACTOR \n    model.add(Conv2D(32,3,activation='relu',input_shape=(80, 80, 1)))\n    model.add(Conv2D(32,4,activation='relu'))\n    model.add(MaxPooling2D(2))\n    model.add(Dropout(0.3))\n    model.add(Conv2D(64,3,activation='relu'))\n    model.add(Conv2D(64,4,activation='relu'))\n    model.add(MaxPooling2D(2))\n    model.add(Dropout(0.3))\n    model.add(Conv2D(84,3,activation='relu'))\n    model.add(Dropout(0.3))\n    #################################### Classifier \n    model.add(Flatten())\n    model.add(Dense(32,activation='relu'))\n    model.add(Dense(32,activation='relu'))\n    model.add(Dense(32,activation='relu'))\n    model.add(Dense(2, activation='softmax')) \n    model.compile(optimizer='Adamax',loss=['CategoricalCrossentropy'],\n                  metrics=['categorical_accuracy'])\n    tf.keras.utils.plot_model(model, 'model.png',show_shapes=True)\n    \n    return model\n\nmodel=model_gen()\nImage('model.png')","metadata":{"execution":{"iopub.status.busy":"2022-02-28T15:38:29.02016Z","iopub.execute_input":"2022-02-28T15:38:29.021084Z","iopub.status.idle":"2022-02-28T15:38:32.322854Z","shell.execute_reply.started":"2022-02-28T15:38:29.021003Z","shell.execute_reply":"2022-02-28T15:38:32.32205Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"def scheduler(epoch, lr):\n    if epoch < 10:\n        return lr\n    else:\n        return lr * tf.math.exp(-0.1)","metadata":{"execution":{"iopub.status.busy":"2022-02-28T15:38:48.346541Z","iopub.execute_input":"2022-02-28T15:38:48.346839Z","iopub.status.idle":"2022-02-28T15:38:48.352414Z","shell.execute_reply.started":"2022-02-28T15:38:48.346808Z","shell.execute_reply":"2022-02-28T15:38:48.351628Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"callbacks = [\n    tf.keras.callbacks.EarlyStopping(patience=5, monitor='val_loss',restore_best_weights=True),\n    tf.keras.callbacks.LearningRateScheduler(scheduler)]","metadata":{"execution":{"iopub.status.busy":"2022-02-28T15:38:49.389898Z","iopub.execute_input":"2022-02-28T15:38:49.390398Z","iopub.status.idle":"2022-02-28T15:38:49.395384Z","shell.execute_reply.started":"2022-02-28T15:38:49.390362Z","shell.execute_reply":"2022-02-28T15:38:49.394301Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"X_dim.shape","metadata":{"execution":{"iopub.status.busy":"2022-02-28T15:38:55.074244Z","iopub.execute_input":"2022-02-28T15:38:55.074509Z","iopub.status.idle":"2022-02-28T15:38:55.080178Z","shell.execute_reply.started":"2022-02-28T15:38:55.074479Z","shell.execute_reply":"2022-02-28T15:38:55.0794Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"history=model.fit(data_gen.flow(X_dim, y, batch_size=64,subset='training'),\n          validation_data=data_gen.flow(X_dim, y,batch_size=8, subset='validation'),epochs=25,callbacks=callbacks, shuffle=True)","metadata":{"execution":{"iopub.status.busy":"2022-02-28T15:39:02.155498Z","iopub.execute_input":"2022-02-28T15:39:02.156017Z","iopub.status.idle":"2022-02-28T15:42:51.176049Z","shell.execute_reply.started":"2022-02-28T15:39:02.155956Z","shell.execute_reply":"2022-02-28T15:42:51.175296Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# Learning Curve","metadata":{}},{"cell_type":"code","source":"plt.plot(history.history['categorical_accuracy'])\nplt.plot(history.history['val_categorical_accuracy'])\nplt.title('model accuracy')\nplt.ylabel('accuracy')\nplt.xlabel('epoch')\nplt.legend(['train', 'val'], loc='upper left')\nplt.show()","metadata":{"execution":{"iopub.status.busy":"2022-02-28T15:42:51.178477Z","iopub.execute_input":"2022-02-28T15:42:51.17924Z","iopub.status.idle":"2022-02-28T15:42:51.379503Z","shell.execute_reply.started":"2022-02-28T15:42:51.179196Z","shell.execute_reply":"2022-02-28T15:42:51.378779Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"plt.plot(history.history['loss'])\nplt.plot(history.history['val_loss'])\nplt.title('model accuracy')\nplt.ylabel('accuracy')\nplt.xlabel('epoch')\nplt.legend(['train', 'val'], loc='upper left')\nplt.show()","metadata":{"execution":{"iopub.status.busy":"2022-02-28T15:42:51.380727Z","iopub.execute_input":"2022-02-28T15:42:51.381173Z","iopub.status.idle":"2022-02-28T15:42:51.566496Z","shell.execute_reply.started":"2022-02-28T15:42:51.381131Z","shell.execute_reply":"2022-02-28T15:42:51.56582Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"X_train, X_valid, y_train, y_valid = train_test_split(X_dim,y,train_size=0.8, test_size=0.2,stratify=y, random_state=0)","metadata":{"execution":{"iopub.status.busy":"2022-02-28T15:42:51.568335Z","iopub.execute_input":"2022-02-28T15:42:51.568601Z","iopub.status.idle":"2022-02-28T15:42:51.760935Z","shell.execute_reply.started":"2022-02-28T15:42:51.568564Z","shell.execute_reply":"2022-02-28T15:42:51.760169Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"model2=model_gen()","metadata":{"execution":{"iopub.status.busy":"2022-02-28T15:43:55.315007Z","iopub.execute_input":"2022-02-28T15:43:55.315553Z","iopub.status.idle":"2022-02-28T15:43:55.600579Z","shell.execute_reply.started":"2022-02-28T15:43:55.315514Z","shell.execute_reply":"2022-02-28T15:43:55.599577Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"history=model2.fit(X_train, y_train, epochs=25,batch_size=64,\n          validation_data=(X_valid,y_valid),callbacks=callbacks, shuffle=True)","metadata":{"execution":{"iopub.status.busy":"2022-02-28T15:43:56.57818Z","iopub.execute_input":"2022-02-28T15:43:56.578831Z","iopub.status.idle":"2022-02-28T15:46:48.107647Z","shell.execute_reply.started":"2022-02-28T15:43:56.578788Z","shell.execute_reply":"2022-02-28T15:46:48.106909Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"plt.plot(history.history['categorical_accuracy'])\nplt.plot(history.history['val_categorical_accuracy'])\nplt.title('model accuracy')\nplt.ylabel('accuracy')\nplt.xlabel('epoch')\nplt.legend(['train', 'val'], loc='upper left')\nplt.show()","metadata":{"execution":{"iopub.status.busy":"2022-02-28T15:46:48.109888Z","iopub.execute_input":"2022-02-28T15:46:48.11017Z","iopub.status.idle":"2022-02-28T15:46:48.309327Z","shell.execute_reply.started":"2022-02-28T15:46:48.110132Z","shell.execute_reply":"2022-02-28T15:46:48.308635Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"plt.plot(history.history['loss'])\nplt.plot(history.history['val_loss'])\nplt.title('model accuracy')\nplt.ylabel('accuracy')\nplt.xlabel('epoch')\nplt.legend(['train', 'val'], loc='upper left')\nplt.show()","metadata":{"execution":{"iopub.status.busy":"2022-02-28T15:46:48.310729Z","iopub.execute_input":"2022-02-28T15:46:48.310993Z","iopub.status.idle":"2022-02-28T15:46:48.493443Z","shell.execute_reply.started":"2022-02-28T15:46:48.310944Z","shell.execute_reply":"2022-02-28T15:46:48.492792Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"model.evaluate(X_valid,y_valid)","metadata":{"execution":{"iopub.status.busy":"2022-02-28T15:46:48.49542Z","iopub.execute_input":"2022-02-28T15:46:48.495918Z","iopub.status.idle":"2022-02-28T15:46:49.494541Z","shell.execute_reply.started":"2022-02-28T15:46:48.495878Z","shell.execute_reply":"2022-02-28T15:46:49.493207Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"model2.evaluate(X_valid,y_valid)","metadata":{"execution":{"iopub.status.busy":"2022-02-28T15:46:49.495927Z","iopub.execute_input":"2022-02-28T15:46:49.496212Z","iopub.status.idle":"2022-02-28T15:46:50.352262Z","shell.execute_reply.started":"2022-02-28T15:46:49.496175Z","shell.execute_reply":"2022-02-28T15:46:50.351615Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"from sklearn.metrics import confusion_matrix , f1_score , classification_report","metadata":{"execution":{"iopub.status.busy":"2022-02-28T15:46:50.353696Z","iopub.execute_input":"2022-02-28T15:46:50.353938Z","iopub.status.idle":"2022-02-28T15:46:50.358131Z","shell.execute_reply.started":"2022-02-28T15:46:50.353904Z","shell.execute_reply":"2022-02-28T15:46:50.357332Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"y_pred = model2.predict(X_valid)","metadata":{"execution":{"iopub.status.busy":"2022-02-28T15:46:50.359826Z","iopub.execute_input":"2022-02-28T15:46:50.360134Z","iopub.status.idle":"2022-02-28T15:46:51.16554Z","shell.execute_reply.started":"2022-02-28T15:46:50.360097Z","shell.execute_reply":"2022-02-28T15:46:51.164689Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"y_valid.shape","metadata":{"execution":{"iopub.status.busy":"2022-02-28T15:46:51.168393Z","iopub.execute_input":"2022-02-28T15:46:51.168923Z","iopub.status.idle":"2022-02-28T15:46:51.174848Z","shell.execute_reply.started":"2022-02-28T15:46:51.168883Z","shell.execute_reply":"2022-02-28T15:46:51.174133Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"y_pred.shape","metadata":{"execution":{"iopub.status.busy":"2022-02-28T15:46:51.176402Z","iopub.execute_input":"2022-02-28T15:46:51.176887Z","iopub.status.idle":"2022-02-28T15:46:51.183917Z","shell.execute_reply.started":"2022-02-28T15:46:51.176849Z","shell.execute_reply":"2022-02-28T15:46:51.182955Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"col_1 = [int(round(p)) for p in y_pred[:,0]]\n","metadata":{"execution":{"iopub.status.busy":"2022-02-28T15:46:51.187083Z","iopub.execute_input":"2022-02-28T15:46:51.187329Z","iopub.status.idle":"2022-02-28T15:46:51.202659Z","shell.execute_reply.started":"2022-02-28T15:46:51.187297Z","shell.execute_reply":"2022-02-28T15:46:51.201874Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"col_2 = [int(round(p)) for p in y_pred[:,1]]","metadata":{"execution":{"iopub.status.busy":"2022-02-28T15:46:51.203763Z","iopub.execute_input":"2022-02-28T15:46:51.204394Z","iopub.status.idle":"2022-02-28T15:46:51.219976Z","shell.execute_reply.started":"2022-02-28T15:46:51.204356Z","shell.execute_reply":"2022-02-28T15:46:51.219285Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"col_1 = np.array(col_1 ,ndmin = 2)\ncol_2 = np.array(col_2,ndmin = 2)","metadata":{"execution":{"iopub.status.busy":"2022-02-28T15:46:51.221172Z","iopub.execute_input":"2022-02-28T15:46:51.221427Z","iopub.status.idle":"2022-02-28T15:46:51.229741Z","shell.execute_reply.started":"2022-02-28T15:46:51.221389Z","shell.execute_reply":"2022-02-28T15:46:51.229007Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"col_2.shape","metadata":{"execution":{"iopub.status.busy":"2022-02-28T15:46:51.230653Z","iopub.execute_input":"2022-02-28T15:46:51.232141Z","iopub.status.idle":"2022-02-28T15:46:51.239648Z","shell.execute_reply.started":"2022-02-28T15:46:51.232103Z","shell.execute_reply":"2022-02-28T15:46:51.238831Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"results =np.transpose(np.concatenate([col_1,col_2],axis=0))\nresults.shape","metadata":{"execution":{"iopub.status.busy":"2022-02-28T15:46:51.240803Z","iopub.execute_input":"2022-02-28T15:46:51.241017Z","iopub.status.idle":"2022-02-28T15:46:51.249205Z","shell.execute_reply.started":"2022-02-28T15:46:51.240983Z","shell.execute_reply":"2022-02-28T15:46:51.248358Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"print(classification_report(results,y_valid))","metadata":{"execution":{"iopub.status.busy":"2022-02-28T15:46:51.250698Z","iopub.execute_input":"2022-02-28T15:46:51.25099Z","iopub.status.idle":"2022-02-28T15:46:51.277108Z","shell.execute_reply.started":"2022-02-28T15:46:51.25094Z","shell.execute_reply":"2022-02-28T15:46:51.276277Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"confusion_matrix(results[:,0],y_valid[:,0])","metadata":{"execution":{"iopub.status.busy":"2022-02-28T16:34:33.712647Z","iopub.execute_input":"2022-02-28T16:34:33.71291Z","iopub.status.idle":"2022-02-28T16:34:33.739935Z","shell.execute_reply.started":"2022-02-28T16:34:33.71288Z","shell.execute_reply":"2022-02-28T16:34:33.739194Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]}]}