{"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-01-28T22:48:11.132013Z","iopub.execute_input":"2024-01-28T22:48:11.133341Z","iopub.status.idle":"2024-01-28T22:48:11.295581Z","shell.execute_reply.started":"2024-01-28T22:48:11.133288Z","shell.execute_reply":"2024-01-28T22:48:11.294266Z"},"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-01-28T22:48:11.298472Z","iopub.execute_input":"2024-01-28T22:48:11.298958Z","iopub.status.idle":"2024-01-28T22:48:11.310458Z","shell.execute_reply.started":"2024-01-28T22:48:11.298896Z","shell.execute_reply":"2024-01-28T22:48:11.309029Z"},"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-01-28T22:48:11.312037Z","iopub.execute_input":"2024-01-28T22:48:11.312473Z","iopub.status.idle":"2024-01-28T22:48:11.361385Z","shell.execute_reply.started":"2024-01-28T22:48:11.312432Z","shell.execute_reply":"2024-01-28T22:48:11.360118Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train_df.nunique()","metadata":{"execution":{"iopub.status.busy":"2024-01-28T22:48:11.362666Z","iopub.execute_input":"2024-01-28T22:48:11.363011Z","iopub.status.idle":"2024-01-28T22:48:11.381789Z","shell.execute_reply.started":"2024-01-28T22:48:11.362981Z","shell.execute_reply":"2024-01-28T22:48:11.380716Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train_df.describe()","metadata":{"execution":{"iopub.status.busy":"2024-01-28T22:48:11.384672Z","iopub.execute_input":"2024-01-28T22:48:11.385089Z","iopub.status.idle":"2024-01-28T22:48:11.41116Z","shell.execute_reply.started":"2024-01-28T22:48:11.385058Z","shell.execute_reply":"2024-01-28T22:48:11.410002Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train_df['label'].value_counts()","metadata":{"execution":{"iopub.status.busy":"2024-01-28T22:48:11.412444Z","iopub.execute_input":"2024-01-28T22:48:11.4128Z","iopub.status.idle":"2024-01-28T22:48:11.425001Z","shell.execute_reply.started":"2024-01-28T22:48:11.412768Z","shell.execute_reply":"2024-01-28T22:48:11.423862Z"},"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-01-28T22:48:11.426693Z","iopub.execute_input":"2024-01-28T22:48:11.427154Z","iopub.status.idle":"2024-01-28T22:48:11.757394Z","shell.execute_reply.started":"2024-01-28T22:48:11.427118Z","shell.execute_reply":"2024-01-28T22:48:11.756232Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train_df.head()","metadata":{"execution":{"iopub.status.busy":"2024-01-28T22:48:11.759212Z","iopub.execute_input":"2024-01-28T22:48:11.75997Z","iopub.status.idle":"2024-01-28T22:48:11.774368Z","shell.execute_reply.started":"2024-01-28T22:48:11.759904Z","shell.execute_reply":"2024-01-28T22:48:11.773135Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train_df.info()","metadata":{"execution":{"iopub.status.busy":"2024-01-28T22:48:11.776396Z","iopub.execute_input":"2024-01-28T22:48:11.777523Z","iopub.status.idle":"2024-01-28T22:48:11.797159Z","shell.execute_reply.started":"2024-01-28T22:48:11.777477Z","shell.execute_reply":"2024-01-28T22:48:11.79592Z"},"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-01-28T22:48:11.798843Z","iopub.execute_input":"2024-01-28T22:48:11.799325Z","iopub.status.idle":"2024-01-28T22:48:11.807532Z","shell.execute_reply.started":"2024-01-28T22:48:11.799291Z","shell.execute_reply":"2024-01-28T22:48:11.806284Z"},"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-01-28T22:48:11.809813Z","iopub.execute_input":"2024-01-28T22:48:11.810725Z","iopub.status.idle":"2024-01-28T22:48:11.819791Z","shell.execute_reply.started":"2024-01-28T22:48:11.810681Z","shell.execute_reply":"2024-01-28T22:48:11.818399Z"},"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-01-28T22:48:11.821605Z","iopub.execute_input":"2024-01-28T22:48:11.823114Z","iopub.status.idle":"2024-01-28T22:48:11.836583Z","shell.execute_reply.started":"2024-01-28T22:48:11.823066Z","shell.execute_reply":"2024-01-28T22:48:11.835263Z"},"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-01-28T22:48:11.837755Z","iopub.execute_input":"2024-01-28T22:48:11.838574Z","iopub.status.idle":"2024-01-28T22:48:11.844618Z","shell.execute_reply.started":"2024-01-28T22:48:11.838539Z","shell.execute_reply":"2024-01-28T22:48:11.843315Z"},"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-01-28T22:48:11.851586Z","iopub.execute_input":"2024-01-28T22:48:11.852017Z","iopub.status.idle":"2024-01-28T22:48:11.864577Z","shell.execute_reply.started":"2024-01-28T22:48:11.851975Z","shell.execute_reply":"2024-01-28T22:48:11.862929Z"},"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-01-28T22:48:11.866138Z","iopub.execute_input":"2024-01-28T22:48:11.866612Z","iopub.status.idle":"2024-01-28T22:48:11.888594Z","shell.execute_reply.started":"2024-01-28T22:48:11.866576Z","shell.execute_reply":"2024-01-28T22:48:11.887543Z"},"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-01-28T22:48:11.890032Z","iopub.execute_input":"2024-01-28T22:48:11.89101Z","iopub.status.idle":"2024-01-28T22:48:11.909789Z","shell.execute_reply.started":"2024-01-28T22:48:11.890967Z","shell.execute_reply":"2024-01-28T22:48:11.908376Z"},"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-01-28T22:48:11.911466Z","iopub.execute_input":"2024-01-28T22:48:11.912194Z","iopub.status.idle":"2024-01-28T22:48:11.931037Z","shell.execute_reply.started":"2024-01-28T22:48:11.91214Z","shell.execute_reply":"2024-01-28T22:48:11.930007Z"},"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-01-28T22:48:11.932865Z","iopub.execute_input":"2024-01-28T22:48:11.933736Z","iopub.status.idle":"2024-01-28T22:48:11.940183Z","shell.execute_reply.started":"2024-01-28T22:48:11.933695Z","shell.execute_reply":"2024-01-28T22:48:11.939032Z"},"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-01-28T22:48:11.94172Z","iopub.execute_input":"2024-01-28T22:48:11.942095Z","iopub.status.idle":"2024-01-28T22:48:11.962351Z","shell.execute_reply.started":"2024-01-28T22:48:11.942065Z","shell.execute_reply":"2024-01-28T22:48:11.961122Z"},"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-01-28T22:48:11.96358Z","iopub.execute_input":"2024-01-28T22:48:11.964025Z","iopub.status.idle":"2024-01-28T22:48:11.9711Z","shell.execute_reply.started":"2024-01-28T22:48:11.963993Z","shell.execute_reply":"2024-01-28T22:48:11.969638Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train_df_no_tma","metadata":{"execution":{"iopub.status.busy":"2024-01-28T22:48:11.972753Z","iopub.execute_input":"2024-01-28T22:48:11.973111Z","iopub.status.idle":"2024-01-28T22:48:11.990338Z","shell.execute_reply.started":"2024-01-28T22:48:11.973081Z","shell.execute_reply":"2024-01-28T22:48:11.989379Z"},"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-01-28T22:48:11.991521Z","iopub.execute_input":"2024-01-28T22:48:11.992073Z","iopub.status.idle":"2024-01-28T22:48:11.999476Z","shell.execute_reply.started":"2024-01-28T22:48:11.99204Z","shell.execute_reply":"2024-01-28T22:48:11.998327Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train_df_tma","metadata":{"execution":{"iopub.status.busy":"2024-01-28T22:48:12.001119Z","iopub.execute_input":"2024-01-28T22:48:12.001588Z","iopub.status.idle":"2024-01-28T22:48:12.020253Z","shell.execute_reply.started":"2024-01-28T22:48:12.001555Z","shell.execute_reply":"2024-01-28T22:48:12.018761Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"s=224","metadata":{"execution":{"iopub.status.busy":"2024-01-28T22:48:12.021583Z","iopub.execute_input":"2024-01-28T22:48:12.02264Z","iopub.status.idle":"2024-01-28T22:48:12.028646Z","shell.execute_reply.started":"2024-01-28T22:48:12.022603Z","shell.execute_reply":"2024-01-28T22:48:12.027563Z"},"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-01-28T22:48:12.030154Z","iopub.execute_input":"2024-01-28T22:48:12.03107Z","iopub.status.idle":"2024-01-28T22:51:02.901379Z","shell.execute_reply.started":"2024-01-28T22:48:12.031026Z","shell.execute_reply":"2024-01-28T22:51:02.899961Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"print(len(image_data))\nprint(len(image_label))","metadata":{"execution":{"iopub.status.busy":"2024-01-28T22:51:02.903059Z","iopub.execute_input":"2024-01-28T22:51:02.903529Z","iopub.status.idle":"2024-01-28T22:51:02.910581Z","shell.execute_reply.started":"2024-01-28T22:51:02.903486Z","shell.execute_reply":"2024-01-28T22:51:02.909382Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"set(image_label)","metadata":{"execution":{"iopub.status.busy":"2024-01-28T22:51:02.91197Z","iopub.execute_input":"2024-01-28T22:51:02.912308Z","iopub.status.idle":"2024-01-28T22:51:02.924812Z","shell.execute_reply.started":"2024-01-28T22:51:02.912279Z","shell.execute_reply":"2024-01-28T22:51:02.924023Z"},"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-01-28T22:51:02.92637Z","iopub.execute_input":"2024-01-28T22:51:02.927361Z","iopub.status.idle":"2024-01-28T22:51:02.934189Z","shell.execute_reply.started":"2024-01-28T22:51:02.927328Z","shell.execute_reply":"2024-01-28T22:51:02.932993Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"set(image_label_1)","metadata":{"execution":{"iopub.status.busy":"2024-01-28T22:51:02.935657Z","iopub.execute_input":"2024-01-28T22:51:02.936139Z","iopub.status.idle":"2024-01-28T22:51:02.9504Z","shell.execute_reply.started":"2024-01-28T22:51:02.936098Z","shell.execute_reply":"2024-01-28T22:51:02.949047Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"len(image_label_1)","metadata":{"execution":{"iopub.status.busy":"2024-01-28T22:51:02.952224Z","iopub.execute_input":"2024-01-28T22:51:02.952904Z","iopub.status.idle":"2024-01-28T22:51:02.959498Z","shell.execute_reply.started":"2024-01-28T22:51:02.952871Z","shell.execute_reply":"2024-01-28T22:51:02.958264Z"},"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-01-28T22:51:02.961056Z","iopub.execute_input":"2024-01-28T22:51:02.961927Z","iopub.status.idle":"2024-01-28T22:51:03.043265Z","shell.execute_reply.started":"2024-01-28T22:51:02.961886Z","shell.execute_reply":"2024-01-28T22:51:03.041991Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"x_train","metadata":{"execution":{"iopub.status.busy":"2024-01-28T22:51:03.045059Z","iopub.execute_input":"2024-01-28T22:51:03.045423Z","iopub.status.idle":"2024-01-28T22:51:03.060473Z","shell.execute_reply.started":"2024-01-28T22:51:03.045393Z","shell.execute_reply":"2024-01-28T22:51:03.059063Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"y_train","metadata":{"execution":{"iopub.status.busy":"2024-01-28T22:51:03.062389Z","iopub.execute_input":"2024-01-28T22:51:03.062783Z","iopub.status.idle":"2024-01-28T22:51:03.075283Z","shell.execute_reply.started":"2024-01-28T22:51:03.06275Z","shell.execute_reply":"2024-01-28T22:51:03.073682Z"},"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-01-28T22:51:03.077351Z","iopub.execute_input":"2024-01-28T22:51:03.07782Z","iopub.status.idle":"2024-01-28T22:51:03.53558Z","shell.execute_reply.started":"2024-01-28T22:51:03.077784Z","shell.execute_reply":"2024-01-28T22:51:03.534407Z"},"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-01-28T22:51:03.536914Z","iopub.execute_input":"2024-01-28T22:51:03.537248Z","iopub.status.idle":"2024-01-28T22:51:03.560227Z","shell.execute_reply.started":"2024-01-28T22:51:03.537219Z","shell.execute_reply":"2024-01-28T22:51:03.55917Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"print('Model Details are : ')\nprint(KerasModel.summary())","metadata":{"execution":{"iopub.status.busy":"2024-01-28T22:51:03.561593Z","iopub.execute_input":"2024-01-28T22:51:03.562175Z","iopub.status.idle":"2024-01-28T22:51:03.612204Z","shell.execute_reply.started":"2024-01-28T22:51:03.562119Z","shell.execute_reply":"2024-01-28T22:51:03.611286Z"},"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-01-28T22:51:03.614368Z","iopub.execute_input":"2024-01-28T22:51:03.614692Z","iopub.status.idle":"2024-01-29T00:08:43.501033Z","shell.execute_reply.started":"2024-01-28T22:51:03.614664Z","shell.execute_reply":"2024-01-29T00:08:43.496978Z"},"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":[]}]}