{"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":"import warnings\nwarnings.filterwarnings(\"ignore\", category=DeprecationWarning)","metadata":{"execution":{"iopub.status.busy":"2022-04-15T18:02:10.776534Z","iopub.execute_input":"2022-04-15T18:02:10.776904Z","iopub.status.idle":"2022-04-15T18:02:10.801419Z","shell.execute_reply.started":"2022-04-15T18:02:10.776817Z","shell.execute_reply":"2022-04-15T18:02:10.800782Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"import numpy as np\nimport pandas as pd ","metadata":{"execution":{"iopub.status.busy":"2022-04-15T18:02:10.802937Z","iopub.execute_input":"2022-04-15T18:02:10.803245Z","iopub.status.idle":"2022-04-15T18:02:10.807683Z","shell.execute_reply.started":"2022-04-15T18:02:10.803211Z","shell.execute_reply":"2022-04-15T18:02:10.806328Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"import os","metadata":{"execution":{"iopub.status.busy":"2022-04-15T18:02:10.808913Z","iopub.execute_input":"2022-04-15T18:02:10.809205Z","iopub.status.idle":"2022-04-15T18:02:10.815001Z","shell.execute_reply.started":"2022-04-15T18:02:10.809171Z","shell.execute_reply":"2022-04-15T18:02:10.814191Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"path = '/kaggle/input/happy-whale-and-dolphin/'\nos.listdir(path)","metadata":{"execution":{"iopub.status.busy":"2022-04-15T18:02:24.005888Z","iopub.execute_input":"2022-04-15T18:02:24.006145Z","iopub.status.idle":"2022-04-15T18:02:24.01508Z","shell.execute_reply.started":"2022-04-15T18:02:24.006115Z","shell.execute_reply":"2022-04-15T18:02:24.01431Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df = pd.read_csv(path+'train.csv')","metadata":{"execution":{"iopub.status.busy":"2022-04-15T18:02:24.959094Z","iopub.execute_input":"2022-04-15T18:02:24.95938Z","iopub.status.idle":"2022-04-15T18:02:25.043019Z","shell.execute_reply.started":"2022-04-15T18:02:24.959349Z","shell.execute_reply":"2022-04-15T18:02:25.042302Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df.head()","metadata":{"execution":{"iopub.status.busy":"2022-04-15T18:02:37.376162Z","iopub.execute_input":"2022-04-15T18:02:37.376761Z","iopub.status.idle":"2022-04-15T18:02:37.39737Z","shell.execute_reply.started":"2022-04-15T18:02:37.376718Z","shell.execute_reply":"2022-04-15T18:02:37.395976Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"len(df)","metadata":{"execution":{"iopub.status.busy":"2022-04-15T18:02:53.898023Z","iopub.execute_input":"2022-04-15T18:02:53.898272Z","iopub.status.idle":"2022-04-15T18:02:53.904127Z","shell.execute_reply.started":"2022-04-15T18:02:53.898245Z","shell.execute_reply":"2022-04-15T18:02:53.903218Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df.info()","metadata":{"execution":{"iopub.status.busy":"2022-04-15T18:02:54.934298Z","iopub.execute_input":"2022-04-15T18:02:54.934828Z","iopub.status.idle":"2022-04-15T18:02:54.969212Z","shell.execute_reply.started":"2022-04-15T18:02:54.934789Z","shell.execute_reply":"2022-04-15T18:02:54.968509Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df.describe()","metadata":{"execution":{"iopub.status.busy":"2022-04-15T18:02:57.786289Z","iopub.execute_input":"2022-04-15T18:02:57.786704Z","iopub.status.idle":"2022-04-15T18:02:57.859414Z","shell.execute_reply.started":"2022-04-15T18:02:57.786669Z","shell.execute_reply":"2022-04-15T18:02:57.858599Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df['individual_id'].value_counts()","metadata":{"execution":{"iopub.status.busy":"2022-04-15T18:03:06.788219Z","iopub.execute_input":"2022-04-15T18:03:06.788547Z","iopub.status.idle":"2022-04-15T18:03:06.80953Z","shell.execute_reply.started":"2022-04-15T18:03:06.788513Z","shell.execute_reply":"2022-04-15T18:03:06.808802Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"len(df['individual_id'].value_counts())","metadata":{"execution":{"iopub.status.busy":"2022-04-15T18:03:10.438121Z","iopub.execute_input":"2022-04-15T18:03:10.438752Z","iopub.status.idle":"2022-04-15T18:03:10.467624Z","shell.execute_reply.started":"2022-04-15T18:03:10.43871Z","shell.execute_reply":"2022-04-15T18:03:10.466094Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df['species'].value_counts()","metadata":{"execution":{"iopub.status.busy":"2022-04-15T18:03:11.607174Z","iopub.execute_input":"2022-04-15T18:03:11.607442Z","iopub.status.idle":"2022-04-15T18:03:11.620934Z","shell.execute_reply.started":"2022-04-15T18:03:11.607411Z","shell.execute_reply":"2022-04-15T18:03:11.620045Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"len(df['species'].value_counts())","metadata":{"execution":{"iopub.status.busy":"2022-04-15T18:03:13.827236Z","iopub.execute_input":"2022-04-15T18:03:13.827966Z","iopub.status.idle":"2022-04-15T18:03:13.841805Z","shell.execute_reply.started":"2022-04-15T18:03:13.827925Z","shell.execute_reply":"2022-04-15T18:03:13.841013Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"import matplotlib.pyplot as plt\nimport seaborn as sns","metadata":{"execution":{"iopub.status.busy":"2022-04-15T18:03:14.748288Z","iopub.execute_input":"2022-04-15T18:03:14.74888Z","iopub.status.idle":"2022-04-15T18:03:15.592849Z","shell.execute_reply.started":"2022-04-15T18:03:14.748844Z","shell.execute_reply":"2022-04-15T18:03:15.592088Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"sns.countplot('species', data=df)","metadata":{"execution":{"iopub.status.busy":"2022-04-15T18:04:15.04822Z","iopub.execute_input":"2022-04-15T18:04:15.048504Z","iopub.status.idle":"2022-04-15T18:04:15.491928Z","shell.execute_reply.started":"2022-04-15T18:04:15.048475Z","shell.execute_reply":"2022-04-15T18:04:15.491165Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"plt.figure(figsize=(10,20))\nsns.countplot(y='species', data=df)","metadata":{"execution":{"iopub.status.busy":"2022-04-15T18:04:19.725498Z","iopub.execute_input":"2022-04-15T18:04:19.726288Z","iopub.status.idle":"2022-04-15T18:04:20.171803Z","shell.execute_reply.started":"2022-04-15T18:04:19.726242Z","shell.execute_reply":"2022-04-15T18:04:20.171132Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"from glob import glob\nfrom tqdm import tqdm","metadata":{"execution":{"iopub.status.busy":"2022-04-15T18:04:28.839282Z","iopub.execute_input":"2022-04-15T18:04:28.839993Z","iopub.status.idle":"2022-04-15T18:04:28.844881Z","shell.execute_reply.started":"2022-04-15T18:04:28.839954Z","shell.execute_reply":"2022-04-15T18:04:28.842884Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"BASE_PATH = \"../input/happy-whale-and-dolphin/train_images/\"\nTRAIN_IMAGES = glob(BASE_PATH + \"train/*.jpg\")","metadata":{"execution":{"iopub.status.busy":"2022-04-15T18:04:32.057426Z","iopub.execute_input":"2022-04-15T18:04:32.05815Z","iopub.status.idle":"2022-04-15T18:04:32.065782Z","shell.execute_reply.started":"2022-04-15T18:04:32.058111Z","shell.execute_reply":"2022-04-15T18:04:32.064911Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"path = BASE_PATH + np.random.choice(df['image'])\nim = plt.imread(path)\nplt.figure(figsize=(15, 6))\nplt.imshow(im)\nplt.title(path.split(\"/\")[-1])\nplt.xticks([]), plt.yticks([])\ndf[df['image']==path.split('/')[-1]]","metadata":{"execution":{"iopub.status.busy":"2022-04-15T18:04:38.958198Z","iopub.execute_input":"2022-04-15T18:04:38.959061Z","iopub.status.idle":"2022-04-15T18:04:39.607674Z","shell.execute_reply.started":"2022-04-15T18:04:38.959016Z","shell.execute_reply":"2022-04-15T18:04:39.606856Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df['label'] = df.species.map(lambda x: 'whale' if 'whale' in x else 'dolphin')","metadata":{"execution":{"iopub.status.busy":"2022-04-15T18:04:50.188849Z","iopub.execute_input":"2022-04-15T18:04:50.18912Z","iopub.status.idle":"2022-04-15T18:04:50.207504Z","shell.execute_reply.started":"2022-04-15T18:04:50.18909Z","shell.execute_reply":"2022-04-15T18:04:50.206848Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df.head()","metadata":{"execution":{"iopub.status.busy":"2022-04-15T18:04:54.187154Z","iopub.execute_input":"2022-04-15T18:04:54.187701Z","iopub.status.idle":"2022-04-15T18:04:54.198916Z","shell.execute_reply.started":"2022-04-15T18:04:54.187662Z","shell.execute_reply":"2022-04-15T18:04:54.198029Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"sns.countplot(df['label'])","metadata":{"execution":{"iopub.status.busy":"2022-04-15T18:05:11.460877Z","iopub.execute_input":"2022-04-15T18:05:11.461159Z","iopub.status.idle":"2022-04-15T18:05:11.723187Z","shell.execute_reply.started":"2022-04-15T18:05:11.46113Z","shell.execute_reply":"2022-04-15T18:05:11.722393Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df.drop('label', axis=1, inplace=True)","metadata":{"execution":{"iopub.status.busy":"2022-04-15T18:05:11.748923Z","iopub.execute_input":"2022-04-15T18:05:11.749311Z","iopub.status.idle":"2022-04-15T18:05:11.763126Z","shell.execute_reply.started":"2022-04-15T18:05:11.749272Z","shell.execute_reply":"2022-04-15T18:05:11.762373Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df.isnull().sum()","metadata":{"execution":{"iopub.status.busy":"2022-04-15T18:05:15.505312Z","iopub.execute_input":"2022-04-15T18:05:15.5056Z","iopub.status.idle":"2022-04-15T18:05:15.526569Z","shell.execute_reply.started":"2022-04-15T18:05:15.505572Z","shell.execute_reply":"2022-04-15T18:05:15.525811Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# df = df.drop_duplicates(subset=['individual_id'],keep='last')","metadata":{"execution":{"iopub.status.busy":"2022-04-15T18:05:15.769719Z","iopub.execute_input":"2022-04-15T18:05:15.770024Z","iopub.status.idle":"2022-04-15T18:05:15.773485Z","shell.execute_reply.started":"2022-04-15T18:05:15.769997Z","shell.execute_reply":"2022-04-15T18:05:15.772618Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"len(df)","metadata":{"execution":{"iopub.status.busy":"2022-04-15T18:05:19.026501Z","iopub.execute_input":"2022-04-15T18:05:19.027122Z","iopub.status.idle":"2022-04-15T18:05:19.032282Z","shell.execute_reply.started":"2022-04-15T18:05:19.027083Z","shell.execute_reply":"2022-04-15T18:05:19.031495Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"from tensorflow.keras.preprocessing import image\nfrom tensorflow.keras.applications.imagenet_utils import preprocess_input","metadata":{"execution":{"iopub.status.busy":"2022-03-22T18:42:33.579261Z","iopub.execute_input":"2022-03-22T18:42:33.580058Z","iopub.status.idle":"2022-03-22T18:42:38.502911Z","shell.execute_reply.started":"2022-03-22T18:42:33.580022Z","shell.execute_reply":"2022-03-22T18:42:38.50216Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"def Loading_Images(data, m, PATH, dataset):\n    print(\"Loading images\")\n    X_train = np.zeros((m, 32, 32, 3))\n    count = 0\n    for fig in tqdm(data['image']):\n        img = image.load_img(PATH+dataset+\"/\"+fig, target_size=(32, 32, 3))\n        x = image.img_to_array(img)\n        x = preprocess_input(x)\n        X_train[count] = x\n        count += 1\n    return X_train","metadata":{"execution":{"iopub.status.busy":"2022-04-15T18:05:28.536254Z","iopub.execute_input":"2022-04-15T18:05:28.536959Z","iopub.status.idle":"2022-04-15T18:05:28.542553Z","shell.execute_reply.started":"2022-04-15T18:05:28.536921Z","shell.execute_reply":"2022-04-15T18:05:28.541836Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{"execution":{"iopub.status.busy":"2022-03-22T19:10:20.184953Z","iopub.execute_input":"2022-03-22T19:10:20.185202Z","iopub.status.idle":"2022-03-22T19:10:20.910283Z","shell.execute_reply.started":"2022-03-22T19:10:20.185175Z","shell.execute_reply":"2022-03-22T19:10:20.909379Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"X = Loading_Images(df, df.shape[0], \"../input/happy-whale-and-dolphin/\", \"train_images\")\nX /= 255","metadata":{"execution":{"iopub.status.busy":"2022-03-22T18:42:38.514826Z","iopub.execute_input":"2022-03-22T18:42:38.515067Z","iopub.status.idle":"2022-03-22T19:10:00.978778Z","shell.execute_reply.started":"2022-03-22T18:42:38.515031Z","shell.execute_reply":"2022-03-22T19:10:00.976615Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"from sklearn.preprocessing import LabelEncoder\nfrom sklearn.preprocessing import OneHotEncoder","metadata":{"execution":{"iopub.status.busy":"2022-03-22T19:10:00.979836Z","iopub.status.idle":"2022-03-22T19:10:00.980312Z","shell.execute_reply.started":"2022-03-22T19:10:00.980076Z","shell.execute_reply":"2022-03-22T19:10:00.980101Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"def prepare_labels(y):\n    values = np.array(y)\n    label_encoder = LabelEncoder()\n    integer_encoded = label_encoder.fit_transform(values)\n    onehot_encoder = OneHotEncoder(sparse=False)\n    integer_encoded = integer_encoded.reshape(len(integer_encoded), 1)\n    onehot_encoded = onehot_encoder.fit_transform(integer_encoded)\n    y = onehot_encoded\n    return y, label_encoder","metadata":{"execution":{"iopub.status.busy":"2022-03-22T19:10:00.983964Z","iopub.status.idle":"2022-03-22T19:10:00.984399Z","shell.execute_reply.started":"2022-03-22T19:10:00.984153Z","shell.execute_reply":"2022-03-22T19:10:00.984175Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"y, label_encoder = prepare_labels(df['individual_id'])","metadata":{"execution":{"iopub.status.busy":"2022-03-22T19:10:00.985716Z","iopub.status.idle":"2022-03-22T19:10:00.986111Z","shell.execute_reply.started":"2022-03-22T19:10:00.985896Z","shell.execute_reply":"2022-03-22T19:10:00.985918Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"y.shape","metadata":{"execution":{"iopub.status.busy":"2022-03-22T19:10:00.987379Z","iopub.status.idle":"2022-03-22T19:10:00.988058Z","shell.execute_reply.started":"2022-03-22T19:10:00.987799Z","shell.execute_reply":"2022-03-22T19:10:00.987825Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"from tensorflow.keras.models import Sequential\nfrom tensorflow.keras.layers import Conv2D, BatchNormalization, Activation, MaxPooling2D, AveragePooling2D, Flatten, Dropout, Dense","metadata":{"execution":{"iopub.status.busy":"2022-03-22T19:10:00.989422Z","iopub.status.idle":"2022-03-22T19:10:00.989821Z","shell.execute_reply.started":"2022-03-22T19:10:00.989607Z","shell.execute_reply":"2022-03-22T19:10:00.989628Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"model = Sequential()\n\nmodel.add(Conv2D(32, (6, 6), strides = (1, 1), input_shape = (32, 32, 3)))\nmodel.add(BatchNormalization(axis = 3))\nmodel.add(Activation('relu'))\n\nmodel.add(MaxPooling2D((2, 2)))\nmodel.add(Conv2D(64, (3, 3), strides = (1,1)))\nmodel.add(Activation('relu'))\nmodel.add(MaxPooling2D((3, 3)))\nmodel.add(Dropout(0.5))\n\nmodel.add(Flatten())\nmodel.add(Dense(512, activation=\"relu\"))\nmodel.add(Dropout(0.5))\n\nmodel.add(Dense(y.shape[1], activation='softmax'))\n\nmodel.compile(loss='categorical_crossentropy', optimizer=\"Adam\", metrics=['accuracy'])\nmodel.summary()","metadata":{"execution":{"iopub.status.busy":"2022-03-22T19:10:00.991156Z","iopub.status.idle":"2022-03-22T19:10:00.991585Z","shell.execute_reply.started":"2022-03-22T19:10:00.991354Z","shell.execute_reply":"2022-03-22T19:10:00.991377Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# history = model.fit(X, y, epochs=100, batch_size=128, verbose=2)","metadata":{"execution":{"iopub.status.busy":"2022-03-22T19:10:00.994917Z","iopub.status.idle":"2022-03-22T19:10:00.995362Z","shell.execute_reply.started":"2022-03-22T19:10:00.995124Z","shell.execute_reply":"2022-03-22T19:10:00.995146Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# model.save('model1.h5')","metadata":{"execution":{"iopub.status.busy":"2022-03-22T19:10:00.996623Z","iopub.status.idle":"2022-03-22T19:10:00.997121Z","shell.execute_reply.started":"2022-03-22T19:10:00.996898Z","shell.execute_reply":"2022-03-22T19:10:00.996921Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# plt.figure(figsize=(15,5))\n# plt.plot(history.history['accuracy'])\n# plt.title('Model accuracy')\n# plt.ylabel('Accuracy')\n# plt.xlabel('Epoch')\n# plt.show()","metadata":{"execution":{"iopub.status.busy":"2022-03-22T19:10:00.998699Z","iopub.status.idle":"2022-03-22T19:10:00.99909Z","shell.execute_reply.started":"2022-03-22T19:10:00.998876Z","shell.execute_reply":"2022-03-22T19:10:00.998898Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# plt.figure(figsize=(15,5))\n# plt.plot(history.history['loss'])\n# plt.title('Model loss')\n# plt.ylabel('loss')\n# plt.xlabel('Epoch')\n# plt.show()","metadata":{"execution":{"iopub.status.busy":"2022-03-22T19:10:01.000305Z","iopub.status.idle":"2022-03-22T19:10:01.001011Z","shell.execute_reply.started":"2022-03-22T19:10:01.000772Z","shell.execute_reply":"2022-03-22T19:10:01.000796Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"from sklearn.model_selection import train_test_split\nX_train, X_valid, y_train, y_valid = train_test_split(X, y, test_size=0.2, random_state=42)","metadata":{"execution":{"iopub.status.busy":"2022-03-22T19:10:01.002177Z","iopub.status.idle":"2022-03-22T19:10:01.00291Z","shell.execute_reply.started":"2022-03-22T19:10:01.002655Z","shell.execute_reply":"2022-03-22T19:10:01.002682Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"history = model.fit(X_train, y_train, epochs=100, batch_size=128, verbose=2, validation_data=(X_valid, y_valid))","metadata":{"execution":{"iopub.status.busy":"2022-03-22T19:10:01.004075Z","iopub.status.idle":"2022-03-22T19:10:01.0045Z","shell.execute_reply.started":"2022-03-22T19:10:01.004258Z","shell.execute_reply":"2022-03-22T19:10:01.00428Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"model.save('model_100_epochs.h5')","metadata":{"execution":{"iopub.status.busy":"2022-03-22T19:10:01.00587Z","iopub.status.idle":"2022-03-22T19:10:01.006261Z","shell.execute_reply.started":"2022-03-22T19:10:01.006049Z","shell.execute_reply":"2022-03-22T19:10:01.006071Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"history_df = pd.DataFrame(history.history)","metadata":{"execution":{"iopub.status.busy":"2022-03-22T19:10:01.00766Z","iopub.status.idle":"2022-03-22T19:10:01.008085Z","shell.execute_reply.started":"2022-03-22T19:10:01.007854Z","shell.execute_reply":"2022-03-22T19:10:01.007878Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"history_df","metadata":{"execution":{"iopub.status.busy":"2022-03-22T19:10:01.009224Z","iopub.status.idle":"2022-03-22T19:10:01.009881Z","shell.execute_reply.started":"2022-03-22T19:10:01.009636Z","shell.execute_reply":"2022-03-22T19:10:01.00966Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"history_df[['accuracy', 'val_accuracy']].plot()\nplt.ylabel(\"accuracy\")\nplt.xlabel(\"epochs\")","metadata":{"execution":{"iopub.status.busy":"2022-03-22T19:10:01.011322Z","iopub.status.idle":"2022-03-22T19:10:01.011755Z","shell.execute_reply.started":"2022-03-22T19:10:01.011536Z","shell.execute_reply":"2022-03-22T19:10:01.011558Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"history_df[['loss', 'val_loss']].plot()\nplt.ylabel(\"accuracy\")\nplt.xlabel(\"epochs\")","metadata":{"execution":{"iopub.status.busy":"2022-03-22T19:10:01.012918Z","iopub.status.idle":"2022-03-22T19:10:01.013479Z","shell.execute_reply.started":"2022-03-22T19:10:01.013223Z","shell.execute_reply":"2022-03-22T19:10:01.013247Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"history_df.plot()\nplt.ylabel(\"loss\")\nplt.xlabel(\"epochs\")","metadata":{"execution":{"iopub.status.busy":"2022-03-22T19:10:01.014849Z","iopub.status.idle":"2022-03-22T19:10:01.015312Z","shell.execute_reply.started":"2022-03-22T19:10:01.015058Z","shell.execute_reply":"2022-03-22T19:10:01.015083Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# train_images=[]\n# test_image=[]\n\n# for images in os.listdir(\"../input/happy-whale-and-dolphin/train_images\"):\n#         if(images.endswith('.jpg')):\n#             train_images.append(images)","metadata":{"execution":{"iopub.status.busy":"2022-03-22T19:10:01.016851Z","iopub.status.idle":"2022-03-22T19:10:01.017248Z","shell.execute_reply.started":"2022-03-22T19:10:01.017033Z","shell.execute_reply":"2022-03-22T19:10:01.017055Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# len(train_images)","metadata":{"execution":{"iopub.status.busy":"2022-03-22T19:10:01.018786Z","iopub.status.idle":"2022-03-22T19:10:01.019182Z","shell.execute_reply.started":"2022-03-22T19:10:01.018968Z","shell.execute_reply":"2022-03-22T19:10:01.018989Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# train_images[:10]","metadata":{"execution":{"iopub.status.busy":"2022-03-22T19:10:01.020428Z","iopub.status.idle":"2022-03-22T19:10:01.021155Z","shell.execute_reply.started":"2022-03-22T19:10:01.020909Z","shell.execute_reply":"2022-03-22T19:10:01.020934Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# dolphin_train_images=train_images[:40827]\n# dolphin_test_images=train_images[40827:]","metadata":{"execution":{"iopub.status.busy":"2022-03-22T19:10:01.022482Z","iopub.status.idle":"2022-03-22T19:10:01.02289Z","shell.execute_reply.started":"2022-03-22T19:10:01.022658Z","shell.execute_reply":"2022-03-22T19:10:01.022679Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# import pandas as pd\n# csv_file=pd.read_csv(\"../input/happy-whale-and-dolphin/train.csv\")","metadata":{"execution":{"iopub.status.busy":"2022-03-22T19:10:01.024023Z","iopub.status.idle":"2022-03-22T19:10:01.024917Z","shell.execute_reply.started":"2022-03-22T19:10:01.024662Z","shell.execute_reply":"2022-03-22T19:10:01.024687Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# csv_file[:5]","metadata":{"execution":{"iopub.status.busy":"2022-03-22T19:10:01.026255Z","iopub.status.idle":"2022-03-22T19:10:01.026686Z","shell.execute_reply.started":"2022-03-22T19:10:01.026468Z","shell.execute_reply":"2022-03-22T19:10:01.02649Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]}]}