In the last we knew, we trained our model.
This is what happened at each epoch.
We got accuracy and loss.
And this was for book training.
And the validation to this was also plotted on the right hand side.
You can see in this graph, this top graph is not lost.
It has blue line for lost on the training set.
And this green line for validation loss.
The graph on the bottom is for accuracy.
This blue line is for training accuracy and the green line is for validation accuracy.
You can see that after you've been to people.
There is not much improvement in the accuracy.
However, we have still run this program for 30 epochs.
Now, as I said in the beginning, the real performance of a model is gauged on previously unseen data.
This is the reason we kept a set of 10000 observations separately.
So now we can predict the class for these test images and compare the accuracy against the actual class
of those images.
Just knowing that the training accuracy that we have achieved is nearly 87 percent.
Now we are going to see if there is different accuracy achieved on the test set.
Now, when we are looking at this performance, instead of just giving these test images and getting
the predicted values, we can give boot images and the actual labels this way using this evaluate function.
Our model can straightaway evaluate and show us the error and accuracy of our model on the test.
So I stole the design of this evaluate function in the score variable.
This evaluate takes two parameters test images and labels.
It uses the model to predict on test images and compares the predicted level against these test labels
to Lexus underscored.
Now, if you want, go see the best loss and test air quality, you can run these two lines of code.
You can see that the loss on test set is due to point forward, one that is on banning say it was zero
point three seven.
And the accuracy on this, it is nearly 85 percent, whereas it was 87 percent.
On the training say this means that there is a little bit of overfitting but will not talk about that
in detail.
It hit.
Now, if you are interested in actual predictions of the classes on the test that we can use to predict
function and just in predict test images.
So this is the predict function.
And it just takes the input of test images.
We do not need to give the test labels it when we get past images.
It applies the model on it and gives us deep predictions.
Next to underscore, you can see that we have predictions on our ten thousand best images.
And it has ten values corresponding to each prediction.
Let's look at those 10 values.
Forty first image in the now since we used an outwardly was the dust softmax function.
If you look at the first set of predictions.
This is a set of ten probabilities.
This is the probability of the first test image belonging to the first class.
This is the probability for the second class and so on to find out which of these probabilities is the
largest so that we can assign that class to that image we used, which taught Max function.
You can see here which dark Max.
And we input these predictions variable.
When I've done this, it tells me that the end value, which is this seven point six six in compendious
to one minus one.
This value is the largest probability.
So we want to assign the class to this image to find out what is the class associated with this tent
position.
If you remember, we created a class name I.D. which stored dawdy names of the classes here, is that
right?
So we want to find out the end element of the city.
We just put that entire which match function to this class, Demitry.
So basically with this which Max will return the position and corresponding to that position, we find
out the last name from this day.
So when we done this, it tells us that the class is ankle boot.
So basically our prediction is that the first image in the test set is of ankle boot.
If you want to check takes look at that image will again use the block function and we block this first
image of this thing.
So when we block this image, you can have a look at this image.
This looks like an ankle boot and which is also our prediction that it is an ankle boot.
So this looks correct.
Lastly, instead of predicting probabilities, you can straightaway predict the flosses also using the
predict classes function.
Here's how we do that, we create a new video we'll call glass spread, and this gets the information
off all the predicted glasses on the best images.
This function also gets only one parameter.
That is the input.
Best images.
And we've done this and we look at the first grindy predictions.
You can see that for the first image we have predicting nine plus.
So you may think that a lead we predicted then.
Why is it number looking nine?
So this tent is the position of the glass label and glass is actually labeled nine because glass labels
are starting from zero.
So both of these represent the same thing.
Ninet label label glass is ankle boot only.
So these are all declasse predictions.
So we have both.
The method one is to predict the probabilities.
Use those predicted properties.
Find out the maximum out of those.
And that glass having the maximum probability will be the predicted glass.
Or you can straightaway you do predict losses function to get the predicted glass on the new best set.
That's all in.
We do.
So we have created a complete neural network classification model.
So here's a summary of whatever we did to build this classification model.
We installed a cross package and we activated it using install, underscore, get.
We installed it.
US go get us Labidi and Antiflu.
We then imported the data we pre-process did and normalized it using that data.
It was in two parts.
It had a train pass and a test flight.
We used to train part to bring our model when we were defining our model.
We had three parts.
One was to give the structure of the model.
The second was configuring the learning process.
And the third was learning the quick function.
Kuprin de model one time model was train reaching its performance on the basic.
And we found out that our model is giving all the performance of 85 percent, which we were satisfied.
So following this entire process, we have created a classification model using neural networks.