August 2018
Intermediate to advanced
438 pages
12h 3m
English
Exploratory analysis helps us get a better understanding of the dataset at hand. The next task is to build an actual classifier for the dataset. As we know, for any classification problem the first and foremost step is to split the dataset into train and validation sets. Since we are utilizing Keras, we would take help from its utilities to help prepare our datasets. The following code snippet showcases the process of organizing the original dataset into train and validation sets:
# Prepare column to store image path data_labels['image_path'] = data_labels.apply( lambda row: (train_folder + row["id"] + ".jpg" ), axis=1) # load image data as arrays of defined size train_data = np.array([img_to_array(load_img(img, target_size=(299, ...
Read now
Unlock full access