Had you got to answer the question, how do we evaluate our models while we make predictions with them
and then we compare the predictions to what the model should have actually done.
So we need to get the labels from the test data set and compare them to these labels and models predictions.
So let's do that.
Well, right now, there's a little note.
Now we've got predictions, array of all of our models, predictions to evaluate them.
We need to compare them to the original test data set levels.
So to do that, to get that we've currently our test data is wrapped up, an intensive low batch data
set.
So we're going to have to unpatched this data set and pull out the labels and get them in a format that's
like this, because what is one of the most important things in machine learning and deep learning is
comparing apples to apples, making sure you tenses are in the right format, and making sure your array
of data in the right shape.
Because if we try to compare this array here to our test data as it is now, we'll just get errors galore.
So that's what we're going to do.
We need to unravel this.
So to get our test labels, we need to unravel our test data batch data set.
And to do so, we're going to create a list called Y Labels is going to be for our test labels and then
we can go for images, labels, because right now our test data might just put it down here just in
case it disappears.
Test data is in a batch of image label tuples.
So we go for images, labels in test data.
Now there's a method for batch data sets intensive low called one batch.
So as you might imagine, this is going to one batch, our data set.
So go from our test data is currently we've seen this before, 790 batches.
Of size 32 of image label Tupperware's, but what we want is we want to unpack all of the test data
and then retrieve just the labels from our test data set.
And now I'm going to do this code before I start jumping around.
So let's do this together.
We're going to go why labels don't append labels don't no high ARG, Max.
Beautiful, and then we're going to have a look at what Y labels the first 10.
Look at the first 10, by the way, this is a Tenzer or an array, the labels of one hot encoded labels.
So the reason why we get Amax is currently test labels look like zero zero zero.
And where the target label is, say, for the class doughnut, it's going to have a one there and then
it'll be dot, dot, dot, and then it'll be zeros for the rest of it for one hundred and one.
We want the index value.
That's what we do.
Amax where the one occurs.
So they're one encoded.
That's why we do amax and we do some pie so that it turns into something like this in array.
Beautiful, but we can see what this does by running, it might take a minute or so because on batching
data does take a fair while, depending on how many batches of data you have.
So I'll let this run.
Excellent.
Now, you might be wondering why we get some labels in all zeros or actually, let's just quickly just
want to know how many why labels are there.
So this is the original test data set labels to Gaylan y labels.
There should be how many?
One for each image.
And we had twenty five thousand two hundred and fifty images.
Beautiful.
So you might be wondering why they're all zero.
Well, it's because when we originally loaded come up here.
When we originally loaded will go to where we loaded our test data, do you remember we set Shuffle
Eagle to false.
So what that means is going to happen.
This is where I told you we're going to come back to where shuffle equals false.
This is so we can make evaluations on our test data set because otherwise, every time we loaded test
data, the order of them would be shuffled.
And so if we made predictions on our test data set and then we unraveled it, it would shuffle at every
time.
And so we couldn't compare apples to apples.
So if we come here because we've turned shuffle off, it means that the test labels that we've now got,
the Y labels array will be in the order of apple pie, first baby back ribs, baklava the governance
of these foods.
So if we come back.
To making predictions with that train model, we've now got to.
A rise of twenty five thousand two hundred fifty, so we've got Y labels, these are original labels
and these are our model's predictions.
So ideally, our model would have the same first ten samples as the true labels.
But we can see there's already some errors here.
So predicting 50 to where it should have been zero.
It's predicting 80, where it should have been zero and so on and so on.
But the important thing is because we don't shuffle off, these are now in the same order.
So when we compare them later on, we can be sure that the index zero, this one lines up with index
zero of our predicted class.
But let's not take my word for it.
Let's write some code in the next few videos to further evaluate and visualize our predictions.
I'll see you there.