1
00:00:01,050 --> 00:00:06,840
Had you got to answer the question, how do we evaluate our models while we make predictions with them

2
00:00:07,320 --> 00:00:11,060
and then we compare the predictions to what the model should have actually done.

3
00:00:11,610 --> 00:00:20,130
So we need to get the labels from the test data set and compare them to these labels and models predictions.

4
00:00:20,640 --> 00:00:21,420
So let's do that.

5
00:00:21,690 --> 00:00:22,850
Well, right now, there's a little note.

6
00:00:23,340 --> 00:00:35,030
Now we've got predictions, array of all of our models, predictions to evaluate them.

7
00:00:35,490 --> 00:00:42,750
We need to compare them to the original test data set levels.

8
00:00:43,500 --> 00:00:50,670
So to do that, to get that we've currently our test data is wrapped up, an intensive low batch data

9
00:00:50,670 --> 00:00:50,970
set.

10
00:00:51,970 --> 00:00:57,820
So we're going to have to unpatched this data set and pull out the labels and get them in a format that's

11
00:00:57,820 --> 00:01:02,170
like this, because what is one of the most important things in machine learning and deep learning is

12
00:01:02,170 --> 00:01:07,720
comparing apples to apples, making sure you tenses are in the right format, and making sure your array

13
00:01:07,720 --> 00:01:09,580
of data in the right shape.

14
00:01:09,580 --> 00:01:16,490
Because if we try to compare this array here to our test data as it is now, we'll just get errors galore.

15
00:01:16,900 --> 00:01:18,090
So that's what we're going to do.

16
00:01:18,100 --> 00:01:19,380
We need to unravel this.

17
00:01:20,920 --> 00:01:31,050
So to get our test labels, we need to unravel our test data batch data set.

18
00:01:31,600 --> 00:01:38,710
And to do so, we're going to create a list called Y Labels is going to be for our test labels and then

19
00:01:38,710 --> 00:01:45,130
we can go for images, labels, because right now our test data might just put it down here just in

20
00:01:45,130 --> 00:01:46,030
case it disappears.

21
00:01:46,180 --> 00:01:51,970
Test data is in a batch of image label tuples.

22
00:01:52,090 --> 00:01:56,680
So we go for images, labels in test data.

23
00:01:57,130 --> 00:02:02,210
Now there's a method for batch data sets intensive low called one batch.

24
00:02:02,830 --> 00:02:07,350
So as you might imagine, this is going to one batch, our data set.

25
00:02:07,630 --> 00:02:15,640
So go from our test data is currently we've seen this before, 790 batches.

26
00:02:16,690 --> 00:02:24,390
Of size 32 of image label Tupperware's, but what we want is we want to unpack all of the test data

27
00:02:24,720 --> 00:02:30,090
and then retrieve just the labels from our test data set.

28
00:02:30,660 --> 00:02:34,170
And now I'm going to do this code before I start jumping around.

29
00:02:34,170 --> 00:02:35,200
So let's do this together.

30
00:02:35,700 --> 00:02:43,920
We're going to go why labels don't append labels don't no high ARG, Max.

31
00:02:45,660 --> 00:02:51,240
Beautiful, and then we're going to have a look at what Y labels the first 10.

32
00:02:52,670 --> 00:03:03,070
Look at the first 10, by the way, this is a Tenzer or an array, the labels of one hot encoded labels.

33
00:03:03,320 --> 00:03:13,190
So the reason why we get Amax is currently test labels look like zero zero zero.

34
00:03:13,400 --> 00:03:19,580
And where the target label is, say, for the class doughnut, it's going to have a one there and then

35
00:03:19,580 --> 00:03:23,780
it'll be dot, dot, dot, and then it'll be zeros for the rest of it for one hundred and one.

36
00:03:24,740 --> 00:03:27,050
We want the index value.

37
00:03:27,060 --> 00:03:27,620
That's what we do.

38
00:03:27,620 --> 00:03:31,850
Amax where the one occurs.

39
00:03:32,510 --> 00:03:33,710
So they're one encoded.

40
00:03:33,900 --> 00:03:39,170
That's why we do amax and we do some pie so that it turns into something like this in array.

41
00:03:40,270 --> 00:03:45,550
Beautiful, but we can see what this does by running, it might take a minute or so because on batching

42
00:03:45,550 --> 00:03:49,360
data does take a fair while, depending on how many batches of data you have.

43
00:03:49,660 --> 00:03:50,560
So I'll let this run.

44
00:03:55,770 --> 00:03:56,400
Excellent.

45
00:03:56,700 --> 00:04:02,940
Now, you might be wondering why we get some labels in all zeros or actually, let's just quickly just

46
00:04:02,940 --> 00:04:07,040
want to know how many why labels are there.

47
00:04:07,170 --> 00:04:11,780
So this is the original test data set labels to Gaylan y labels.

48
00:04:11,970 --> 00:04:13,050
There should be how many?

49
00:04:13,620 --> 00:04:14,990
One for each image.

50
00:04:15,000 --> 00:04:18,690
And we had twenty five thousand two hundred and fifty images.

51
00:04:18,720 --> 00:04:19,370
Beautiful.

52
00:04:19,890 --> 00:04:22,240
So you might be wondering why they're all zero.

53
00:04:22,830 --> 00:04:27,360
Well, it's because when we originally loaded come up here.

54
00:04:28,890 --> 00:04:34,710
When we originally loaded will go to where we loaded our test data, do you remember we set Shuffle

55
00:04:34,710 --> 00:04:35,650
Eagle to false.

56
00:04:36,300 --> 00:04:37,890
So what that means is going to happen.

57
00:04:37,920 --> 00:04:41,050
This is where I told you we're going to come back to where shuffle equals false.

58
00:04:41,220 --> 00:04:46,290
This is so we can make evaluations on our test data set because otherwise, every time we loaded test

59
00:04:46,290 --> 00:04:48,890
data, the order of them would be shuffled.

60
00:04:48,900 --> 00:04:54,900
And so if we made predictions on our test data set and then we unraveled it, it would shuffle at every

61
00:04:54,900 --> 00:04:55,200
time.

62
00:04:55,200 --> 00:04:57,360
And so we couldn't compare apples to apples.

63
00:04:57,900 --> 00:05:03,270
So if we come here because we've turned shuffle off, it means that the test labels that we've now got,

64
00:05:03,540 --> 00:05:11,730
the Y labels array will be in the order of apple pie, first baby back ribs, baklava the governance

65
00:05:11,730 --> 00:05:12,470
of these foods.

66
00:05:12,840 --> 00:05:13,590
So if we come back.

67
00:05:14,640 --> 00:05:17,400
To making predictions with that train model, we've now got to.

68
00:05:18,270 --> 00:05:23,820
A rise of twenty five thousand two hundred fifty, so we've got Y labels, these are original labels

69
00:05:24,060 --> 00:05:25,650
and these are our model's predictions.

70
00:05:25,800 --> 00:05:32,250
So ideally, our model would have the same first ten samples as the true labels.

71
00:05:32,250 --> 00:05:34,710
But we can see there's already some errors here.

72
00:05:34,710 --> 00:05:36,900
So predicting 50 to where it should have been zero.

73
00:05:37,410 --> 00:05:42,000
It's predicting 80, where it should have been zero and so on and so on.

74
00:05:42,130 --> 00:05:48,020
But the important thing is because we don't shuffle off, these are now in the same order.

75
00:05:48,240 --> 00:05:54,570
So when we compare them later on, we can be sure that the index zero, this one lines up with index

76
00:05:54,570 --> 00:05:56,190
zero of our predicted class.

77
00:05:56,460 --> 00:05:57,840
But let's not take my word for it.

78
00:05:58,200 --> 00:06:02,850
Let's write some code in the next few videos to further evaluate and visualize our predictions.

79
00:06:03,360 --> 00:06:03,930
I'll see you there.

