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 targetsize variable contains the dimensions that each image in the data set will be resized to
The batchsize variable represents the size of batches of data that the method will be applied to
The classmode 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 images belonging to classes.
Now that this is done, we can move on to preprocessing our test data.
Please print the output of traininggenerator.flowfromdirectory as an image here 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 flowfromdirectory method to the ImageDataGenerator class that was just created
Here is the code to do this:
testgenerator ImageDataGeneratorrescale
testset testgenerator.flowfromdirectorytestdata',
targetsize
batchsize
classmode 'binary'
Once you run this command, the following output will be printed:
Found images belonging to classes.
Please print the output of testgenerator.flowfromdirectory as an image here Mark
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
