{"metadata":{"kernelspec":{"language":"python","display_name":"Python 3","name":"python3"},"language_info":{"name":"python","version":"3.10.12","mimetype":"text/x-python","codemirror_mode":{"name":"ipython","version":3},"pygments_lexer":"ipython3","nbconvert_exporter":"python","file_extension":".py"},"kaggle":{"accelerator":"none","dataSources":[{"sourceId":45867,"databundleVersionId":6924515,"sourceType":"competition"}],"dockerImageVersionId":30635,"isInternetEnabled":true,"language":"python","sourceType":"notebook","isGpuEnabled":false}},"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\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":"2024-02-06T04:39:18.759256Z","iopub.execute_input":"2024-02-06T04:39:18.760071Z","iopub.status.idle":"2024-02-06T04:39:19.662134Z","shell.execute_reply.started":"2024-02-06T04:39:18.760024Z","shell.execute_reply":"2024-02-06T04:39:19.66099Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"import warnings\nwarnings.filterwarnings('ignore')\n\nimport os\nimport pandas as pd\nimport numpy as np\nimport matplotlib.pyplot as plt\n%matplotlib inline\nfrom sklearn.metrics import classification_report , confusion_matrix , accuracy_score , auc\nfrom sklearn.model_selection import train_test_split\nimport seaborn as sns\nimport cv2 as cv\nfrom PIL import Image \nimport tensorflow as tf\nfrom tensorflow import keras\nfrom keras import Sequential\nfrom keras.layers import Input, Dense,Conv2D , MaxPooling2D, Flatten,BatchNormalization,Dropout\nfrom tensorflow.keras.preprocessing import image_dataset_from_directory\nimport tensorflow_hub as hub ","metadata":{"execution":{"iopub.status.busy":"2024-02-06T04:43:56.126003Z","iopub.execute_input":"2024-02-06T04:43:56.126541Z","iopub.status.idle":"2024-02-06T04:43:56.138643Z","shell.execute_reply.started":"2024-02-06T04:43:56.126504Z","shell.execute_reply":"2024-02-06T04:43:56.137318Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train_df=pd.read_csv(\"/kaggle/input/UBC-OCEAN/train.csv\")\ntrain_df","metadata":{"execution":{"iopub.status.busy":"2024-02-06T04:41:07.357896Z","iopub.execute_input":"2024-02-06T04:41:07.358885Z","iopub.status.idle":"2024-02-06T04:41:07.404822Z","shell.execute_reply.started":"2024-02-06T04:41:07.358845Z","shell.execute_reply":"2024-02-06T04:41:07.403658Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train_df.nunique()","metadata":{"execution":{"iopub.status.busy":"2024-02-06T04:44:00.917552Z","iopub.execute_input":"2024-02-06T04:44:00.91828Z","iopub.status.idle":"2024-02-06T04:44:00.940808Z","shell.execute_reply.started":"2024-02-06T04:44:00.918226Z","shell.execute_reply":"2024-02-06T04:44:00.939335Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train_df.describe()","metadata":{"execution":{"iopub.status.busy":"2024-02-06T04:44:04.21706Z","iopub.execute_input":"2024-02-06T04:44:04.21819Z","iopub.status.idle":"2024-02-06T04:44:04.251774Z","shell.execute_reply.started":"2024-02-06T04:44:04.218127Z","shell.execute_reply":"2024-02-06T04:44:04.250196Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train_df['label'].value_counts()","metadata":{"execution":{"iopub.status.busy":"2024-02-06T04:44:07.486604Z","iopub.execute_input":"2024-02-06T04:44:07.487062Z","iopub.status.idle":"2024-02-06T04:44:07.501165Z","shell.execute_reply.started":"2024-02-06T04:44:07.487025Z","shell.execute_reply":"2024-02-06T04:44:07.499989Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train_df['label'].value_counts().plot(kind='pie',autopct=\"%.1f%%\")\nplt.title(\"Ovarian Cancer Types Distributions\")\nplt.legend()\nplt.show()","metadata":{"execution":{"iopub.status.busy":"2024-02-06T04:44:14.883947Z","iopub.execute_input":"2024-02-06T04:44:14.8844Z","iopub.status.idle":"2024-02-06T04:44:15.219703Z","shell.execute_reply.started":"2024-02-06T04:44:14.884364Z","shell.execute_reply":"2024-02-06T04:44:15.218344Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train_df.head()","metadata":{"execution":{"iopub.status.busy":"2024-02-06T04:44:48.154617Z","iopub.execute_input":"2024-02-06T04:44:48.155092Z","iopub.status.idle":"2024-02-06T04:44:48.170728Z","shell.execute_reply.started":"2024-02-06T04:44:48.155054Z","shell.execute_reply":"2024-02-06T04:44:48.168984Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train_df.info()","metadata":{"execution":{"iopub.status.busy":"2024-02-06T04:44:51.521209Z","iopub.execute_input":"2024-02-06T04:44:51.521654Z","iopub.status.idle":"2024-02-06T04:44:51.543088Z","shell.execute_reply.started":"2024-02-06T04:44:51.521614Z","shell.execute_reply":"2024-02-06T04:44:51.541626Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"#large size\npath_train =\"/kaggle/input/UBC-OCEAN/train_images\"\npath_test =\"/kaggle/input/UBC-OCEAN/test_images\"\ntrain_folder = os.listdir(path_train)\ntest_folder = os.listdir(path_test)\nprint(len(train_folder))\nprint(len(test_folder))","metadata":{"execution":{"iopub.status.busy":"2024-02-06T04:44:54.643661Z","iopub.execute_input":"2024-02-06T04:44:54.644118Z","iopub.status.idle":"2024-02-06T04:44:54.653186Z","shell.execute_reply.started":"2024-02-06T04:44:54.64408Z","shell.execute_reply":"2024-02-06T04:44:54.651927Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"#images in small size\npath_train_copy = \"/kaggle/input/UBC-OCEAN/train_thumbnails\"\npath_test_copy = \"/kaggle/input/UBC-OCEAN/test_thumbnails\"\ntrain_folder_copy = os.listdir(path_train_copy)\ntest_folder_copy = os.listdir(path_test_copy)\nprint(len(train_folder_copy))\nprint(len(test_folder_copy))","metadata":{"execution":{"iopub.status.busy":"2024-02-06T04:44:58.68559Z","iopub.execute_input":"2024-02-06T04:44:58.685989Z","iopub.status.idle":"2024-02-06T04:44:58.696624Z","shell.execute_reply.started":"2024-02-06T04:44:58.685958Z","shell.execute_reply":"2024-02-06T04:44:58.695018Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"from sklearn.model_selection import train_test_split\nimport pandas as pd\ndf = pd.read_csv('/kaggle/input/UBC-OCEAN/train.csv')\nx = df.iloc[:,0:4].values\ny = df.iloc[:,0:1].values\ntrain_x, val_x, train_y, val_y = train_test_split(x, y, random_state = 0)","metadata":{"execution":{"iopub.status.busy":"2024-02-06T04:45:01.071623Z","iopub.execute_input":"2024-02-06T04:45:01.072037Z","iopub.status.idle":"2024-02-06T04:45:01.083911Z","shell.execute_reply.started":"2024-02-06T04:45:01.072004Z","shell.execute_reply":"2024-02-06T04:45:01.082879Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"print(f\"val_y shape: {val_y.shape}\")\nprint(f\"train_x shape: {train_x.shape}\")","metadata":{"execution":{"iopub.status.busy":"2024-02-06T04:45:04.367529Z","iopub.execute_input":"2024-02-06T04:45:04.368044Z","iopub.status.idle":"2024-02-06T04:45:04.375045Z","shell.execute_reply.started":"2024-02-06T04:45:04.368008Z","shell.execute_reply":"2024-02-06T04:45:04.373779Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"import os\n\ntrain_images_folder = '/kaggle/input/UBC-OCEAN/train_images'\ntrain_thumbnails_folder = '/kaggle/input/UBC-OCEAN/train_thumbnails'\n\nimages_files = set(os.listdir(train_images_folder))\nthumbnails_files = set(os.listdir(train_thumbnails_folder))\n\nimages_filenames = set([filename.split('.')[0] for filename in images_files])\n\nthumbnails_filenames = set([filename.split('_')[0] for filename in thumbnails_files])\n\nmissing_thumbnails = images_filenames - thumbnails_filenames\nmissing_thumbnails=[name+'.png' for name in missing_thumbnails]\n\nprint(\"TMA list:\")\nfor file_name in missing_thumbnails:\n    print(file_name)","metadata":{"execution":{"iopub.status.busy":"2024-02-06T04:45:06.830516Z","iopub.execute_input":"2024-02-06T04:45:06.830936Z","iopub.status.idle":"2024-02-06T04:45:06.843471Z","shell.execute_reply.started":"2024-02-06T04:45:06.830903Z","shell.execute_reply":"2024-02-06T04:45:06.841961Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"import pandas as pd\n\ndf=pd.read_csv('/kaggle/input/UBC-OCEAN/train.csv')\ndf","metadata":{"execution":{"iopub.status.busy":"2024-02-06T04:45:11.531156Z","iopub.execute_input":"2024-02-06T04:45:11.531592Z","iopub.status.idle":"2024-02-06T04:45:11.552944Z","shell.execute_reply.started":"2024-02-06T04:45:11.531557Z","shell.execute_reply":"2024-02-06T04:45:11.551703Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"is_tma_df=df[df['is_tma']]\nis_tma_df","metadata":{"execution":{"iopub.status.busy":"2024-02-06T04:45:14.979036Z","iopub.execute_input":"2024-02-06T04:45:14.979452Z","iopub.status.idle":"2024-02-06T04:45:14.995745Z","shell.execute_reply.started":"2024-02-06T04:45:14.979419Z","shell.execute_reply":"2024-02-06T04:45:14.994572Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"is_not_tma_df=df[df['is_tma']==False]\nis_not_tma_df","metadata":{"execution":{"iopub.status.busy":"2024-02-06T04:45:20.72292Z","iopub.execute_input":"2024-02-06T04:45:20.723416Z","iopub.status.idle":"2024-02-06T04:45:20.743194Z","shell.execute_reply.started":"2024-02-06T04:45:20.723378Z","shell.execute_reply":"2024-02-06T04:45:20.741797Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train_df_tma = train_df[train_df['is_tma']==True]","metadata":{"execution":{"iopub.status.busy":"2024-02-06T04:45:25.792399Z","iopub.execute_input":"2024-02-06T04:45:25.7928Z","iopub.status.idle":"2024-02-06T04:45:25.798928Z","shell.execute_reply.started":"2024-02-06T04:45:25.792768Z","shell.execute_reply":"2024-02-06T04:45:25.797805Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train_df_no_tma = train_df[train_df['is_tma']==False]\ntrain_df_no_tma","metadata":{"execution":{"iopub.status.busy":"2024-02-06T04:45:35.213108Z","iopub.execute_input":"2024-02-06T04:45:35.213549Z","iopub.status.idle":"2024-02-06T04:45:35.232702Z","shell.execute_reply.started":"2024-02-06T04:45:35.213514Z","shell.execute_reply":"2024-02-06T04:45:35.23136Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train_df_no_tma['image_id_path'] = [f\"{i}_thumbnail.png\" for i in train_df_no_tma['image_id']]","metadata":{"execution":{"iopub.status.busy":"2024-02-06T04:45:43.570656Z","iopub.execute_input":"2024-02-06T04:45:43.5711Z","iopub.status.idle":"2024-02-06T04:45:43.578765Z","shell.execute_reply.started":"2024-02-06T04:45:43.571066Z","shell.execute_reply":"2024-02-06T04:45:43.577369Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train_df_no_tma","metadata":{"execution":{"iopub.status.busy":"2024-02-06T04:45:47.187393Z","iopub.execute_input":"2024-02-06T04:45:47.187861Z","iopub.status.idle":"2024-02-06T04:45:47.209261Z","shell.execute_reply.started":"2024-02-06T04:45:47.187826Z","shell.execute_reply":"2024-02-06T04:45:47.207681Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train_df_tma['image_id_path'] = [f\"{i}.png\" for i in train_df_tma['image_id']]","metadata":{"execution":{"iopub.status.busy":"2024-02-06T04:45:50.930266Z","iopub.execute_input":"2024-02-06T04:45:50.93075Z","iopub.status.idle":"2024-02-06T04:45:50.937233Z","shell.execute_reply.started":"2024-02-06T04:45:50.930715Z","shell.execute_reply":"2024-02-06T04:45:50.936364Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train_df_tma","metadata":{"execution":{"iopub.status.busy":"2024-02-06T04:45:54.043917Z","iopub.execute_input":"2024-02-06T04:45:54.044421Z","iopub.status.idle":"2024-02-06T04:45:54.061421Z","shell.execute_reply.started":"2024-02-06T04:45:54.044381Z","shell.execute_reply":"2024-02-06T04:45:54.060554Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"s=224","metadata":{"execution":{"iopub.status.busy":"2024-02-06T04:45:58.126937Z","iopub.execute_input":"2024-02-06T04:45:58.127427Z","iopub.status.idle":"2024-02-06T04:45:58.134522Z","shell.execute_reply.started":"2024-02-06T04:45:58.127388Z","shell.execute_reply":"2024-02-06T04:45:58.132804Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"print(len(image_data))\nprint(len(image_label))","metadata":{"execution":{"iopub.status.busy":"2024-02-06T04:53:17.115206Z","iopub.execute_input":"2024-02-06T04:53:17.115672Z","iopub.status.idle":"2024-02-06T04:53:17.122007Z","shell.execute_reply.started":"2024-02-06T04:53:17.115635Z","shell.execute_reply":"2024-02-06T04:53:17.120882Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"image_data = []\nimage_label = []\npath = \"/kaggle/input/UBC-OCEAN/train_thumbnails\"\npath1=\"/kaggle/input/UBC-OCEAN/train_images/\"\nfor img , label in zip(train_df_no_tma['image_id_path'],train_df_no_tma['label']):\n    image = Image.open(\"/kaggle/input/UBC-OCEAN/train_thumbnails/\"+img)\n    image = image.resize((s,s))\n    image = image.convert(\"RGB\")\n    image = np.array(image)\n    image_data.append(image)\n    image_label.append(label)\n\nfor img , label in zip(train_df_tma['image_id_path'],train_df_tma['label']):\n    image = Image.open(\"/kaggle/input/UBC-OCEAN/train_images/\"+img)\n    image = image.resize((s,s))\n    image = image.convert(\"RGB\")\n    image = np.array(image)\n    image_data.append(image)\n    image_label.append(label)","metadata":{"execution":{"iopub.status.busy":"2024-02-06T04:50:37.180792Z","iopub.execute_input":"2024-02-06T04:50:37.181265Z","iopub.status.idle":"2024-02-06T04:52:59.069813Z","shell.execute_reply.started":"2024-02-06T04:50:37.181229Z","shell.execute_reply":"2024-02-06T04:52:59.068479Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"set(image_label)","metadata":{"execution":{"iopub.status.busy":"2024-02-06T04:53:21.706449Z","iopub.execute_input":"2024-02-06T04:53:21.706889Z","iopub.status.idle":"2024-02-06T04:53:21.716795Z","shell.execute_reply.started":"2024-02-06T04:53:21.706854Z","shell.execute_reply":"2024-02-06T04:53:21.715274Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"image_label_1 = []\nfor i in image_label:\n    if i==\"CC\":\n        image_label_1.append(0)\n    elif i==\"EC\":\n        image_label_1.append(1)\n    elif i==\"HGSC\":\n        image_label_1.append(2)\n    elif i==\"LGSC\":\n        image_label_1.append(3)\n    elif i==\"MC\":\n        image_label_1.append(4)","metadata":{"execution":{"iopub.status.busy":"2024-02-06T04:53:26.482729Z","iopub.execute_input":"2024-02-06T04:53:26.483181Z","iopub.status.idle":"2024-02-06T04:53:26.490549Z","shell.execute_reply.started":"2024-02-06T04:53:26.483146Z","shell.execute_reply":"2024-02-06T04:53:26.48921Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"set(image_label_1)","metadata":{"execution":{"iopub.status.busy":"2024-02-06T04:53:29.893135Z","iopub.execute_input":"2024-02-06T04:53:29.89455Z","iopub.status.idle":"2024-02-06T04:53:29.902367Z","shell.execute_reply.started":"2024-02-06T04:53:29.89449Z","shell.execute_reply":"2024-02-06T04:53:29.901377Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"len(image_label_1)","metadata":{"execution":{"iopub.status.busy":"2024-02-06T04:53:32.530319Z","iopub.execute_input":"2024-02-06T04:53:32.531579Z","iopub.status.idle":"2024-02-06T04:53:32.538792Z","shell.execute_reply.started":"2024-02-06T04:53:32.531527Z","shell.execute_reply":"2024-02-06T04:53:32.537763Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"x = np.array(image_data)\ny = np.array(image_label_1)\nx_train , x_test, y_train, y_test = train_test_split(x,y,test_size=0.2,shuffle=True)\nprint(f'X_train shape  is {x_train.shape}')\nprint(f'X_test shape  is {x_test.shape}')\nprint(f'y_train shape  is {y_train.shape}')\nprint(f'y_test shape  is {y_test.shape}')","metadata":{"execution":{"iopub.status.busy":"2024-02-06T04:53:35.714449Z","iopub.execute_input":"2024-02-06T04:53:35.715347Z","iopub.status.idle":"2024-02-06T04:53:35.833061Z","shell.execute_reply.started":"2024-02-06T04:53:35.715261Z","shell.execute_reply":"2024-02-06T04:53:35.83216Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"x_train","metadata":{"execution":{"iopub.status.busy":"2024-02-06T04:53:39.132602Z","iopub.execute_input":"2024-02-06T04:53:39.133787Z","iopub.status.idle":"2024-02-06T04:53:39.147387Z","shell.execute_reply.started":"2024-02-06T04:53:39.13373Z","shell.execute_reply":"2024-02-06T04:53:39.145672Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"y_train","metadata":{"execution":{"iopub.status.busy":"2024-02-06T04:53:47.386713Z","iopub.execute_input":"2024-02-06T04:53:47.387192Z","iopub.status.idle":"2024-02-06T04:53:47.397984Z","shell.execute_reply.started":"2024-02-06T04:53:47.387154Z","shell.execute_reply":"2024-02-06T04:53:47.396475Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"KerasModel = keras.models.Sequential([\n        keras.layers.Conv2D(200,kernel_size=(3,3),activation='relu',input_shape=(s,s,3)),\n        keras.layers.Conv2D(150,kernel_size=(3,3),activation='relu'),\n        keras.layers.MaxPool2D(2,2),\n        keras.layers.Conv2D(120,kernel_size=(3,3),activation='relu'),    \n        keras.layers.Conv2D(80,kernel_size=(3,3),activation='relu'),    \n        keras.layers.Conv2D(50,kernel_size=(3,3),activation='relu'),\n        keras.layers.MaxPool2D(2,2),\n        keras.layers.Flatten() ,    \n        keras.layers.Dense(120,activation='relu') ,    \n        keras.layers.Dense(100,activation='relu') ,    \n        keras.layers.Dense(50,activation='relu') ,        \n        keras.layers.Dropout(rate=0.2) ,            \n        keras.layers.Dense(5,activation='softmax') ,    \n        ])","metadata":{"execution":{"iopub.status.busy":"2024-02-06T04:53:51.495762Z","iopub.execute_input":"2024-02-06T04:53:51.496409Z","iopub.status.idle":"2024-02-06T04:53:51.984849Z","shell.execute_reply.started":"2024-02-06T04:53:51.496362Z","shell.execute_reply":"2024-02-06T04:53:51.98353Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"KerasModel.compile(optimizer ='adam',loss='sparse_categorical_crossentropy',metrics=['accuracy'])","metadata":{"execution":{"iopub.status.busy":"2024-02-06T04:53:56.134053Z","iopub.execute_input":"2024-02-06T04:53:56.134517Z","iopub.status.idle":"2024-02-06T04:53:56.162204Z","shell.execute_reply.started":"2024-02-06T04:53:56.134482Z","shell.execute_reply":"2024-02-06T04:53:56.161041Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"print('Model Details are : ')\nprint(KerasModel.summary())","metadata":{"execution":{"iopub.status.busy":"2024-02-06T04:53:58.745028Z","iopub.execute_input":"2024-02-06T04:53:58.745477Z","iopub.status.idle":"2024-02-06T04:53:58.795639Z","shell.execute_reply.started":"2024-02-06T04:53:58.745443Z","shell.execute_reply":"2024-02-06T04:53:58.794452Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"epochs = 10\nThisModel = KerasModel.fit(x_train, y_train, epochs=epochs,batch_size=64,verbose=1)","metadata":{"execution":{"iopub.status.busy":"2024-02-06T04:54:08.757823Z","iopub.execute_input":"2024-02-06T04:54:08.758286Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"ModelLoss, ModelAccuracy = KerasModel.evaluate(x_test, y_test)\n\nprint('Test Loss is {}'.format(ModelLoss))\nprint('Test Accuracy is {}'.format(ModelAccuracy ))","metadata":{"execution":{"iopub.status.busy":"2024-01-29T00:08:43.507589Z","iopub.execute_input":"2024-01-29T00:08:43.508293Z","iopub.status.idle":"2024-01-29T00:09:24.957263Z","shell.execute_reply.started":"2024-01-29T00:08:43.508235Z","shell.execute_reply":"2024-01-29T00:09:24.955911Z"},"trusted":true},"execution_count":null,"outputs":[]}]}