{"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":30587,"isInternetEnabled":true,"language":"python","sourceType":"notebook","isGpuEnabled":false}},"nbformat_minor":4,"nbformat":4,"cells":[{"cell_type":"code","source":"!pip install imutils","metadata":{"execution":{"iopub.status.busy":"2023-11-24T04:52:20.669075Z","iopub.execute_input":"2023-11-24T04:52:20.6697Z","iopub.status.idle":"2023-11-24T04:52:39.82801Z","shell.execute_reply.started":"2023-11-24T04:52:20.669647Z","shell.execute_reply":"2023-11-24T04:52:39.826784Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"import tensorflow as tf\nimport pandas as pd\nimport os\nos.environ[\"CUDA_DEVICE_ORDER\"] = \"PCI_BUS_ID\"  # see issue #152\nos.environ['CUDA_VISIBLE_DEVICES'] = '0'  # -1  to USE CPU\nfrom keras.layers import Conv2D, Input, ZeroPadding2D, BatchNormalization, Activation, MaxPooling2D, Flatten, Dense,Dropout\nfrom keras.models import Model, load_model\nfrom keras.callbacks import TensorBoard, ModelCheckpoint, ReduceLROnPlateau\nfrom sklearn.model_selection import train_test_split\nfrom sklearn.metrics import f1_score\nfrom sklearn.utils import shuffle\nimport cv2\nimport imutils\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport time\nfrom os import listdir\n\n%matplotlib inline","metadata":{"execution":{"iopub.status.busy":"2023-11-24T04:52:39.830917Z","iopub.execute_input":"2023-11-24T04:52:39.831318Z","iopub.status.idle":"2023-11-24T04:52:56.102636Z","shell.execute_reply.started":"2023-11-24T04:52:39.831282Z","shell.execute_reply":"2023-11-24T04:52:56.101492Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"def image_contour(image, plot=False):\n\n    # Convert the image to grayscale, and blur it slightly\n    gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)\n    gray = cv2.GaussianBlur(gray, (5, 5), 0)\n\n    # Threshold the image, then perform a series of erosions +\n    # dilations to remove any small regions of noise\n    thresh = cv2.threshold(gray, 45, 255, cv2.THRESH_BINARY)[1]\n    thresh = cv2.erode(thresh, None, iterations=2)\n    thresh = cv2.dilate(thresh, None, iterations=2)\n\n    # Find contours in thresholded image, then grab the largest one\n    cnts = cv2.findContours(thresh.copy(), cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE)\n    cnts = imutils.grab_contours(cnts)\n    c = max(cnts, key=cv2.contourArea)\n\n    # Find the extreme points\n    extLeft = tuple(c[c[:, :, 0].argmin()][0])\n    extRight = tuple(c[c[:, :, 0].argmax()][0])\n    extTop = tuple(c[c[:, :, 1].argmin()][0])\n    extBot = tuple(c[c[:, :, 1].argmax()][0])\n\n    # crop new image out of the original image using the four extreme points (left, right, top, bottom)\n    new_image = image[extTop[1]:extBot[1], extLeft[0]:extRight[0]]\n\n    if plot:\n        plt.figure()\n\n        plt.subplot(1, 2, 1)\n        plt.imshow(image)\n\n        plt.tick_params(axis='both', which='both',\n                        top=False, bottom=False, left=False, right=False,\n                        labelbottom=False, labeltop=False, labelleft=False, labelright=False)\n        plt.title('Original Image')\n        plt.subplot(1, 2, 2)\n        plt.imshow(new_image)\n        plt.tick_params(axis='both', which='both',\n                        top=False, bottom=False, left=False, right=False,\n                        labelbottom=False, labeltop=False, labelleft=False, labelright=False)\n        plt.title('Cropped Image')\n        plt.show()\n    return new_image","metadata":{"execution":{"iopub.status.busy":"2023-11-24T04:52:56.104277Z","iopub.execute_input":"2023-11-24T04:52:56.1056Z","iopub.status.idle":"2023-11-24T04:52:56.123965Z","shell.execute_reply.started":"2023-11-24T04:52:56.105515Z","shell.execute_reply":"2023-11-24T04:52:56.122688Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train_data=pd.read_csv('/kaggle/input/UBC-OCEAN/train.csv')\ntrain_data","metadata":{"execution":{"iopub.status.busy":"2023-11-24T04:52:56.125702Z","iopub.execute_input":"2023-11-24T04:52:56.126216Z","iopub.status.idle":"2023-11-24T04:52:56.185857Z","shell.execute_reply.started":"2023-11-24T04:52:56.126172Z","shell.execute_reply":"2023-11-24T04:52:56.184447Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"import pandas as pd\n\n# Assuming 'train_data' is your DataFrame\nimage_paths = []\n\nfor index, row in train_data.iterrows():\n    if row['is_tma']:\n        image_path = f'/kaggle/input/UBC-OCEAN/train_images/{row[\"image_id\"]}.png'\n    else:\n        image_path = f'/kaggle/input/UBC-OCEAN/train_thumbnails/{row[\"image_id\"]}_thumbnail.png'\n    \n    image_paths.append(image_path)\n\n# Add the image paths to a new column\ntrain_data['image_path'] = image_paths\n\n# Display the updated DataFrame\ntrain_data.head()","metadata":{"execution":{"iopub.status.busy":"2023-11-24T04:52:56.190333Z","iopub.execute_input":"2023-11-24T04:52:56.190954Z","iopub.status.idle":"2023-11-24T04:52:56.263993Z","shell.execute_reply.started":"2023-11-24T04:52:56.190905Z","shell.execute_reply":"2023-11-24T04:52:56.262682Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"ex_img = cv2.imread('/kaggle/input/UBC-OCEAN/train_thumbnails/10077_thumbnail.png')\nex_new_img = image_contour(ex_img, True)","metadata":{"execution":{"iopub.status.busy":"2023-11-24T04:52:56.265761Z","iopub.execute_input":"2023-11-24T04:52:56.266202Z","iopub.status.idle":"2023-11-24T04:52:59.123417Z","shell.execute_reply.started":"2023-11-24T04:52:56.266169Z","shell.execute_reply":"2023-11-24T04:52:59.122264Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"def load_data(train_data, image_size):\n    X = []\n    y = []\n    image_width, image_height = image_size\n    \n    for index, row in train_data.iterrows():\n        image_path = row['image_path']\n        label = row['label']  # Assuming 'label' is the column containing the class labels\n\n        # Load the image\n        image = cv2.imread(image_path)\n        \n        # Crop the brain contour (you may need to define the crop_brain_contour function)\n        image = image_contour(image, plot=False)\n        \n        # Resize the image\n        image = cv2.resize(image, dsize=(image_width, image_height), interpolation=cv2.INTER_CUBIC)\n        \n        # Normalize values\n        image = image / 255.\n        \n        # Convert image to numpy array and append it to X\n        X.append(image)\n        \n        # Append the label to y\n        y.append(label)\n    \n    X = np.array(X)\n    y = np.array(y)\n    \n    # Shuffle the data\n    indices = np.arange(len(X))\n    np.random.shuffle(indices)\n    X = X[indices]\n    y = y[indices]\n\n    print('Number of examples is: {}'.format(len(X)))\n    \n    return X, y\n\n# Assuming 'train_data' is your DataFrame\nimage_paths = []\n\nfor index, row in train_data.iterrows():\n    if row['is_tma']:\n        image_path = f'/kaggle/input/UBC-OCEAN/train_images/{row[\"image_id\"]}.png'\n    else:\n        image_path = f'/kaggle/input/UBC-OCEAN/train_thumbnails/{row[\"image_id\"]}_thumbnail.png'\n\n    image_paths.append(image_path)\n\n# Add the image paths to a new column\ntrain_data['image_path'] = image_paths\n\n# Display the updated DataFrame\ntrain_data.head()\n\n# Load data using the modified load_data function\nimage_size = (256, 256)  # Adjust as needed\nX, y = load_data(train_data, image_size)","metadata":{"execution":{"iopub.status.busy":"2023-11-24T04:52:59.125019Z","iopub.execute_input":"2023-11-24T04:52:59.1262Z","iopub.status.idle":"2023-11-24T04:55:15.384117Z","shell.execute_reply.started":"2023-11-24T04:52:59.126151Z","shell.execute_reply":"2023-11-24T04:55:15.38287Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"import matplotlib.pyplot as plt\n\n# Load the first 50 images and labels\nnum_samples = 50\nsample_images = X[:num_samples]\nsample_labels = y[:num_samples]\n\n# Plot the images\nplt.figure(figsize=(30, 20))\nfor i in range(num_samples):\n    plt.subplot(5, 10, i + 1)\n    plt.imshow(sample_images[i])\n    plt.title(f'Label: {sample_labels[i]}')\n    plt.axis('off')\n\nplt.show()","metadata":{"execution":{"iopub.status.busy":"2023-11-24T04:55:15.385828Z","iopub.execute_input":"2023-11-24T04:55:15.386229Z","iopub.status.idle":"2023-11-24T04:55:21.312009Z","shell.execute_reply.started":"2023-11-24T04:55:15.386194Z","shell.execute_reply":"2023-11-24T04:55:21.310518Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# Load the next 50 images and labels\nnum_samples_next = 50\nsample_images_next = X[num_samples:num_samples + num_samples_next]\nsample_labels_next = y[num_samples:num_samples + num_samples_next]\n\n# Plot the next set of images\nplt.figure(figsize=(30, 20))\nfor i in range(num_samples_next):\n    plt.subplot(5, 10, i + 1)\n    plt.imshow(sample_images_next[i])\n    plt.title(f'Label: {sample_labels_next[i]}')\n    plt.axis('off')\n\nplt.show()","metadata":{"execution":{"iopub.status.busy":"2023-11-24T04:55:21.313976Z","iopub.execute_input":"2023-11-24T04:55:21.315012Z","iopub.status.idle":"2023-11-24T04:55:27.150876Z","shell.execute_reply.started":"2023-11-24T04:55:21.314971Z","shell.execute_reply":"2023-11-24T04:55:27.149351Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# Load the next 50 images and labels\nnum_samples_next2 = 50\nsample_images_next2 = X[num_samples + num_samples_next:num_samples + num_samples_next + num_samples_next2]\nsample_labels_next2 = y[num_samples + num_samples_next:num_samples + num_samples_next + num_samples_next2]\n\n# Plot the next set of images\nplt.figure(figsize=(30, 20))\nfor i in range(num_samples_next2):\n    plt.subplot(5, 10, i + 1)\n    plt.imshow(sample_images_next2[i])\n    plt.title(f'Label: {sample_labels_next2[i]}')\n    plt.axis('off')\n\nplt.show()","metadata":{"execution":{"iopub.status.busy":"2023-11-24T04:55:27.153424Z","iopub.execute_input":"2023-11-24T04:55:27.154227Z","iopub.status.idle":"2023-11-24T04:55:33.712419Z","shell.execute_reply.started":"2023-11-24T04:55:27.154154Z","shell.execute_reply":"2023-11-24T04:55:33.710358Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# Load the next 50 images and labels\nnum_samples_next3 = 50\nsample_images_next3 = X[num_samples + num_samples_next + num_samples_next2:num_samples + num_samples_next + num_samples_next2 + num_samples_next3]\nsample_labels_next3 = y[num_samples + num_samples_next + num_samples_next2:num_samples + num_samples_next + num_samples_next2 + num_samples_next3]\n\n# Plot the next set of images\nplt.figure(figsize=(30, 20))\nfor i in range(num_samples_next3):\n    plt.subplot(5, 10, i + 1)\n    plt.imshow(sample_images_next3[i])\n    plt.title(f'Label: {sample_labels_next3[i]}')\n    plt.axis('off')\n\nplt.show()","metadata":{"execution":{"iopub.status.busy":"2023-11-24T04:55:33.713858Z","iopub.execute_input":"2023-11-24T04:55:33.714218Z","iopub.status.idle":"2023-11-24T04:55:41.377311Z","shell.execute_reply.started":"2023-11-24T04:55:33.714188Z","shell.execute_reply":"2023-11-24T04:55:41.374181Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# Load the next 50 images and labels\nnum_samples_next4 = 50\nsample_images_next4 = X[num_samples + num_samples_next + num_samples_next2 + num_samples_next3:num_samples + num_samples_next + num_samples_next2 + num_samples_next3 + num_samples_next4]\nsample_labels_next4 = y[num_samples + num_samples_next + num_samples_next2 + num_samples_next3:num_samples + num_samples_next + num_samples_next2 + num_samples_next3 + num_samples_next4]\n\n# Plot the next set of images\nplt.figure(figsize=(30, 20))\nfor i in range(num_samples_next4):\n    plt.subplot(5, 10, i + 1)\n    plt.imshow(sample_images_next4[i])\n    plt.title(f'Label: {sample_labels_next4[i]}')\n    plt.axis('off')\n\nplt.show()","metadata":{"execution":{"iopub.status.busy":"2023-11-24T04:55:41.38097Z","iopub.execute_input":"2023-11-24T04:55:41.381426Z","iopub.status.idle":"2023-11-24T04:55:47.589441Z","shell.execute_reply.started":"2023-11-24T04:55:41.381393Z","shell.execute_reply":"2023-11-24T04:55:47.587642Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# Load the next 50 images and labels\nnum_samples_next5 = 50\nsample_images_next5 = X[num_samples + num_samples_next + num_samples_next2 + num_samples_next3 + num_samples_next4:num_samples + num_samples_next + num_samples_next2 + num_samples_next3 + num_samples_next4 + num_samples_next5]\nsample_labels_next5 = y[num_samples + num_samples_next + num_samples_next2 + num_samples_next3 + num_samples_next4:num_samples + num_samples_next + num_samples_next2 + num_samples_next3 + num_samples_next4 + num_samples_next5]\n\n# Plot the next set of images\nplt.figure(figsize=(30, 20))\nfor i in range(num_samples_next5):\n    plt.subplot(5, 10, i + 1)\n    plt.imshow(sample_images_next5[i])\n    plt.title(f'Label: {sample_labels_next5[i]}')\n    plt.axis('off')\n\nplt.show()","metadata":{"execution":{"iopub.status.busy":"2023-11-24T04:55:47.591463Z","iopub.execute_input":"2023-11-24T04:55:47.591918Z","iopub.status.idle":"2023-11-24T04:55:53.665985Z","shell.execute_reply.started":"2023-11-24T04:55:47.591882Z","shell.execute_reply":"2023-11-24T04:55:53.663959Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# Load the next 50 images and labels\nnum_samples_next6 = 50\nsample_images_next6 = X[num_samples + num_samples_next + num_samples_next2 + num_samples_next3 + num_samples_next4 + num_samples_next5:num_samples + num_samples_next + num_samples_next2 + num_samples_next3 + num_samples_next4 + num_samples_next5 + num_samples_next6]\nsample_labels_next6 = y[num_samples + num_samples_next + num_samples_next2 + num_samples_next3 + num_samples_next4 + num_samples_next5:num_samples + num_samples_next + num_samples_next2 + num_samples_next3 + num_samples_next4 + num_samples_next5 + num_samples_next6]\n\n# Plot the next set of images\nplt.figure(figsize=(30, 20))\nfor i in range(num_samples_next6):\n    plt.subplot(5, 10, i + 1)\n    plt.imshow(sample_images_next6[i])\n    plt.title(f'Label: {sample_labels_next6[i]}')\n    plt.axis('off')\n\nplt.show()","metadata":{"execution":{"iopub.status.busy":"2023-11-24T04:55:53.670841Z","iopub.execute_input":"2023-11-24T04:55:53.671303Z","iopub.status.idle":"2023-11-24T04:55:59.833722Z","shell.execute_reply.started":"2023-11-24T04:55:53.671263Z","shell.execute_reply":"2023-11-24T04:55:59.832818Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# Load the next 50 images and labels\nnum_samples_next7 = 50\nsample_images_next7 = X[num_samples + num_samples_next + num_samples_next2 + num_samples_next3 + num_samples_next4 + num_samples_next5 + num_samples_next6:num_samples + num_samples_next + num_samples_next2 + num_samples_next3 + num_samples_next4 + num_samples_next5 + num_samples_next6 + num_samples_next7]\nsample_labels_next7 = y[num_samples + num_samples_next + num_samples_next2 + num_samples_next3 + num_samples_next4 + num_samples_next5 + num_samples_next6:num_samples + num_samples_next + num_samples_next2 + num_samples_next3 + num_samples_next4 + num_samples_next5 + num_samples_next6 + num_samples_next7]\n\n# Plot the next set of images\nplt.figure(figsize=(30, 20))\nfor i in range(num_samples_next7):\n    plt.subplot(5, 10, i + 1)\n    plt.imshow(sample_images_next7[i])\n    plt.title(f'Label: {sample_labels_next7[i]}')\n    plt.axis('off')\n\nplt.show()","metadata":{"execution":{"iopub.status.busy":"2023-11-24T04:55:59.835348Z","iopub.execute_input":"2023-11-24T04:55:59.83603Z","iopub.status.idle":"2023-11-24T04:56:06.040303Z","shell.execute_reply.started":"2023-11-24T04:55:59.835991Z","shell.execute_reply":"2023-11-24T04:56:06.039123Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# Load the next 50 images and labels\nnum_samples_next8 = 50\nsample_images_next8 = X[num_samples + num_samples_next + num_samples_next2 + num_samples_next3 + num_samples_next4 + num_samples_next5 + num_samples_next6 + num_samples_next7:num_samples + num_samples_next + num_samples_next2 + num_samples_next3 + num_samples_next4 + num_samples_next5 + num_samples_next6 + num_samples_next7 + num_samples_next8]\nsample_labels_next8 = y[num_samples + num_samples_next + num_samples_next2 + num_samples_next3 + num_samples_next4 + num_samples_next5 + num_samples_next6 + num_samples_next7:num_samples + num_samples_next + num_samples_next2 + num_samples_next3 + num_samples_next4 + num_samples_next5 + num_samples_next6 + num_samples_next7 + num_samples_next8]\n\n# Plot the next set of images\nplt.figure(figsize=(30, 20))\nfor i in range(num_samples_next8):\n    plt.subplot(5, 10, i + 1)\n    plt.imshow(sample_images_next8[i])\n    plt.title(f'Label: {sample_labels_next8[i]}')\n    plt.axis('off')\n\nplt.show()","metadata":{"execution":{"iopub.status.busy":"2023-11-24T04:56:06.042051Z","iopub.execute_input":"2023-11-24T04:56:06.042473Z","iopub.status.idle":"2023-11-24T04:56:12.188547Z","shell.execute_reply.started":"2023-11-24T04:56:06.042438Z","shell.execute_reply":"2023-11-24T04:56:12.187079Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# Assuming you have already imported necessary libraries like matplotlib.pyplot\n\n# Load the next 50 images and labels\nnum_samples_next8 = 50\nsample_images_next8 = X[num_samples + num_samples_next + num_samples_next2 + num_samples_next3 + num_samples_next4 + num_samples_next5 + num_samples_next6 + num_samples_next7:num_samples + num_samples_next + num_samples_next2 + num_samples_next3 + num_samples_next4 + num_samples_next5 + num_samples_next6 + num_samples_next7 + num_samples_next8]\nsample_labels_next8 = y[num_samples + num_samples_next + num_samples_next2 + num_samples_next3 + num_samples_next4 + num_samples_next5 + num_samples_next6 + num_samples_next7:num_samples + num_samples_next + num_samples_next2 + num_samples_next3 + num_samples_next4 + num_samples_next5 + num_samples_next6 + num_samples_next7 + num_samples_next8]\n\n# Plot the next set of images\nplt.figure(figsize=(30, 20))\nfor i in range(num_samples_next8):\n    plt.subplot(5, 10, i + 1)\n    plt.imshow(sample_images_next8[i])\n    plt.title(f'Label: {sample_labels_next8[i]}')\n    plt.axis('off')\n\nplt.show()\n","metadata":{"execution":{"iopub.status.busy":"2023-11-24T04:56:12.191161Z","iopub.execute_input":"2023-11-24T04:56:12.192925Z","iopub.status.idle":"2023-11-24T04:56:18.311398Z","shell.execute_reply.started":"2023-11-24T04:56:12.192874Z","shell.execute_reply":"2023-11-24T04:56:18.310257Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# Assuming you have already imported necessary libraries like matplotlib.pyplot\n\n# Load the next 38 images and labels\nnum_samples_next38 = 38\nsample_images_next38 = X[num_samples + num_samples_next + num_samples_next2 + num_samples_next3 + num_samples_next4 + num_samples_next5 + num_samples_next6 + num_samples_next7:num_samples + num_samples_next + num_samples_next2 + num_samples_next3 + num_samples_next4 + num_samples_next5 + num_samples_next6 + num_samples_next7 + num_samples_next8 + num_samples_next38]\nsample_labels_next38 = y[num_samples + num_samples_next + num_samples_next2 + num_samples_next3 + num_samples_next4 + num_samples_next5 + num_samples_next6 + num_samples_next7:num_samples + num_samples_next + num_samples_next2 + num_samples_next3 + num_samples_next4 + num_samples_next5 + num_samples_next6 + num_samples_next7 + num_samples_next8 + num_samples_next38]\n\n# Plot the next set of images\nplt.figure(figsize=(30, 20))\nfor i in range(num_samples_next38):\n    plt.subplot(5, 10, i + 1)\n    plt.imshow(sample_images_next38[i])\n    plt.title(f'Label: {sample_labels_next38[i]}')\n    plt.axis('off')\n\nplt.show()","metadata":{"execution":{"iopub.status.busy":"2023-11-24T04:56:18.313043Z","iopub.execute_input":"2023-11-24T04:56:18.313928Z","iopub.status.idle":"2023-11-24T04:56:22.674448Z","shell.execute_reply.started":"2023-11-24T04:56:18.31389Z","shell.execute_reply":"2023-11-24T04:56:22.673025Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"from sklearn.model_selection import train_test_split\n\n# Split the data\nX_train, y_train, X_val, y_val, X_test, y_test = split_data(X, y, test_size=0.2)\n\n# Now you can access X_train\nprint(X_train.shape)  # This should print the shape of your training data\n","metadata":{"execution":{"iopub.status.busy":"2023-11-24T04:56:22.676146Z","iopub.execute_input":"2023-11-24T04:56:22.676562Z","iopub.status.idle":"2023-11-24T04:56:23.544231Z","shell.execute_reply.started":"2023-11-24T04:56:22.676527Z","shell.execute_reply":"2023-11-24T04:56:23.542785Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"print (\"number of training examples = \" + str(X_train.shape[0]))\nprint (\"number of development examples = \" + str(X_val.shape[0]))\nprint (\"number of test examples = \" + str(X_test.shape[0]))\nprint (\"X_train shape: \" + str(X_train.shape))\nprint (\"Y_train shape: \" + str(y_train.shape))\nprint (\"X_val (dev) shape: \" + str(X_val.shape))\nprint (\"Y_val (dev) shape: \" + str(y_val.shape))\nprint (\"X_test shape: \" + str(X_test.shape))\nprint (\"Y_test shape: \" + str(y_test.shape))","metadata":{"execution":{"iopub.status.busy":"2023-11-24T04:56:23.545502Z","iopub.status.idle":"2023-11-24T04:56:23.546633Z","shell.execute_reply.started":"2023-11-24T04:56:23.546379Z","shell.execute_reply":"2023-11-24T04:56:23.546403Z"},"trusted":true},"execution_count":null,"outputs":[]}]}