Welcome to the session in which we shall be focusing on data visualization.
So we want to be able to generate visualizations such that we have images and their corresponding labels.
Now we're going to make use of matplotlib for that.
So let's go through our data set.
So for I sample in enumerate um train data set take let's say we want to visualize 16 samples.
The first 16 samples we will have uh make use of subplots from matplotlib subplot.
And then it's going to be 4x4.
Then we increment I and then we have plot image show to show the image.
But here we have our sample.
And then here we specify image.
There we go.
And then we have the title.
Now the use of this title is simple.
We want to be able to have the corresponding label.
So we have um sample.
And then now we have label.
So let's run that and then see what we get.
We get in subplot not defined.
This should be actually plot.
So we're making use of matplotlib for that.
Now, with this next error, what we could do is simply print out our sample label and you'll find that
we have this integer, um, tensor, which we get.
Now what we could do is we could simply do numpy.
NumPy.
And then uh, once we obtain the one from there we would simply say um get label or get label string.
So this takes in an integer.
So here is going to be the label.
And then we're going to return the corresponding string.
So if so if our label is equal is equal zero we return um we return parasitized parasitized.
And then else else we return on infected.
So that's it.
So um if it's zero then we have parasitized.
If it is one then we have uninfected.
Let's run that.
And then now we will have get label get label string.
And then we get that corresponding label.
So now we have numpy.
There we go.
We close that up and then we run this.
Looking at this here you could see the corresponding uh the different labels.
So we should could now take this off.
And here we have our corresponding plot.
So you see we have this image uninfected uninfected uninfected.
And you have the parasitized.
So that's it.
So we have our different images and their corresponding labels.