1
00:00:00,050 --> 00:00:04,640
Welcome to the session in which we shall be focusing on data visualization.

2
00:00:04,640 --> 00:00:13,100
So we want to be able to generate visualizations such that we have images and their corresponding labels.

3
00:00:13,100 --> 00:00:15,440
Now we're going to make use of matplotlib for that.

4
00:00:15,440 --> 00:00:17,300
So let's go through our data set.

5
00:00:17,300 --> 00:00:28,010
So for I sample in enumerate um train data set take let's say we want to visualize 16 samples.

6
00:00:28,010 --> 00:00:35,780
The first 16 samples we will have uh make use of subplots from matplotlib subplot.

7
00:00:35,780 --> 00:00:38,030
And then it's going to be 4x4.

8
00:00:38,060 --> 00:00:45,200
Then we increment I and then we have plot image show to show the image.

9
00:00:45,200 --> 00:00:47,420
But here we have our sample.

10
00:00:47,420 --> 00:00:49,970
And then here we specify image.

11
00:00:49,970 --> 00:00:50,930
There we go.

12
00:00:50,930 --> 00:00:53,390
And then we have the title.

13
00:00:53,390 --> 00:00:55,340
Now the use of this title is simple.

14
00:00:55,340 --> 00:00:58,610
We want to be able to have the corresponding label.

15
00:00:58,610 --> 00:01:02,060
So we have um sample.

16
00:01:02,060 --> 00:01:04,790
And then now we have label.

17
00:01:04,790 --> 00:01:07,310
So let's run that and then see what we get.

18
00:01:08,260 --> 00:01:10,240
We get in subplot not defined.

19
00:01:10,270 --> 00:01:11,680
This should be actually plot.

20
00:01:11,680 --> 00:01:14,050
So we're making use of matplotlib for that.

21
00:01:15,030 --> 00:01:23,070
Now, with this next error, what we could do is simply print out our sample label and you'll find that

22
00:01:23,070 --> 00:01:26,700
we have this integer, um, tensor, which we get.

23
00:01:26,730 --> 00:01:31,380
Now what we could do is we could simply do numpy.

24
00:01:31,410 --> 00:01:32,730
NumPy.

25
00:01:32,730 --> 00:01:41,970
And then uh, once we obtain the one from there we would simply say um get label or get label string.

26
00:01:41,970 --> 00:01:43,950
So this takes in an integer.

27
00:01:43,950 --> 00:01:46,350
So here is going to be the label.

28
00:01:46,350 --> 00:01:50,340
And then we're going to return the corresponding string.

29
00:01:50,340 --> 00:02:04,020
So if so if our label is equal is equal zero we return um we return parasitized parasitized.

30
00:02:04,020 --> 00:02:12,360
And then else else we return on infected.

31
00:02:12,360 --> 00:02:13,290
So that's it.

32
00:02:13,290 --> 00:02:17,010
So um if it's zero then we have parasitized.

33
00:02:17,010 --> 00:02:19,260
If it is one then we have uninfected.

34
00:02:19,290 --> 00:02:20,430
Let's run that.

35
00:02:20,430 --> 00:02:27,750
And then now we will have get label get label string.

36
00:02:27,750 --> 00:02:30,090
And then we get that corresponding label.

37
00:02:30,090 --> 00:02:32,070
So now we have numpy.

38
00:02:33,000 --> 00:02:34,020
There we go.

39
00:02:34,020 --> 00:02:38,220
We close that up and then we run this.

40
00:02:38,220 --> 00:02:41,640
Looking at this here you could see the corresponding uh the different labels.

41
00:02:41,640 --> 00:02:43,740
So we should could now take this off.

42
00:02:43,740 --> 00:02:46,800
And here we have our corresponding plot.

43
00:02:46,800 --> 00:02:50,580
So you see we have this image uninfected uninfected uninfected.

44
00:02:50,580 --> 00:02:52,020
And you have the parasitized.

45
00:02:52,020 --> 00:02:53,340
So that's it.

46
00:02:53,340 --> 00:02:57,960
So we have our different images and their corresponding labels.
