Question: The first parameter is the folder that the training data is contained in The target _ size variable contains the dimensions that each image in

The first parameter is the folder that the training data is contained in
The target_size variable contains the dimensions that each image in the data set will be resized to
The batch_size variable represents the size of batches of data that the method will be applied to
The class_mode specifies which time of classifier you're building. The two main options are binary (for two classes) or categorical (for two or more classes). There are other options which you can read about in the keras documentation if desired.
Once you run this command, you should see the following output:
Found 8000 images belonging to 2 classes.
Now that this is done, we can move on to preprocessing our test data.
Please print the output of training_generator.flow_from_directory as an image here [1 Mark]
Preprocessing the Test Data
As mentioned, we will not be applying image augmentation techniques to our test data. We want the test data to remain unchanged (which would be the case if our machine learning model was deployed in production).
Preprocessing our test data is comprised of two steps:
Creating a new ImageDataGenerator class that excludes the image augmentation arguments that we used on our training data
Applying the same flow_from_directory method to the ImageDataGenerator class that was just created
Here is the code to do this:
test_generator = ImageDataGenerator(rescale =1./255)
test_set = test_generator.flow_from_directory('test_data',
target_size =(64,64),
batch_size =32,
class_mode = 'binary')
Once you run this command, the following output will be printed:
Found 2000 images belonging to 2 classes.
Please print the output of test_generator.flow_from_directory as an image here [1 Mark]

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!