Let's start by importing our peanuts.
As we've discussed earlier, we are going to use defection and my NIST dataset to classify images of
fashion objects such as trousers, Gord's boots, etc. Fashion Emini USD is a very popular dataset.
It is relatively small and is used to verify that an algorithm books as expected or not.
Fashion amnesty consists of a training set of 60000 examples and a test set of intelligent examples,
each example is a 28 by 28 grayscale image.
That is, it has twenty eight pixels by twenty eight pixels dimensions, and it is a black and white
image.
With each image, there is an associated label of 10 glasses.
I'll tell you the images after we import the dataset.
Let's run this line of code to import data, say.
You know, there are multiple ways to import data here.
We are using these in big data set that comes with Deke.
Get us Labidi.
So if they get us back, it is not and start this line more book.
If it is installed, you will get the dataset imported into this video building, which is fashion and
does quote Ammonite SD.
You can see on the right in the enrollment video bill window here exactly does it.
Next, view this dataset by clicking on it.
Here you can see that this dataset has to pass, train and test.
This means that it is already divided into two parts of training and testing.
We do not need to do this separately.
However, if you want to learn how to separate any dataset into train and test, which is not in this
format, please take the opening section of this course.
There you will find a lecture titled This Train Split.
With that, you will be able to split any dataset.
Martin's Head.
Our dataset is already split.
Let's go for the train set for that has two parts X and Y.
X is the set of predictive variables and Y is the list of output values.
That is the class of deflection object.
You can see the structure of X and Y also her X is a set of 60000 images, which are 28 pixel by 28
pixel.
So for each image, we have a value between zero and 255.
If the value is zero, that pixel is black.
If it is 255, that bookseller's white.
So each individual pixels data for all the 60000 images is stored.
And this expert even.
Similarly, why has dick glassware loose of 60000 images, for example, the first image as the glass.
Nine what this 90 percent.
Look at that in something similar to the green that we have data only differences in the training set.
We have 60000 images, data in plastic.
We have 10000 data.
We will use just train data to print model.
And later on, we will predictive y values for this desk using the X values of this test.
Then we will compare the actual Y values in this test set with the predicted Y values from our model
to find out the accuracy of our model.
Now let's go back to our code.
We'll be assigning the X and Y dream values to separate variables.
To do that, this line of code is the standard way in which we assign value to a variable.
You can run this line also and it will give you the same result.
It will assign the X value of the training set of fashion m NASD variable into the train images.
We will, however, get us.
Allows us to do that in a different way.
In this format, you can assign the two variables brain images and train labels at the same time.
So if you run this line of code, this will assign the X values of brain to print images and derive
value of frame to train labels.
Next on this line, of course.
Now you can see that we have a train images variable and then labeled variable, then images has the
X part and bring labels has the bypass.
Same goes with the test images and test labels.
Next one.
This code also.
And we have two more variables here, although we have seen the structure of training data and test
data.
If you still want to check out the structure of these new variables, you can order these two lines
of code.
Them.
And within decades, variable name gives you the dimension of this variable to this variable has three
dimensions.
First is the 60000 values of different images and then 28 across 28.
For all the individual pixels, if you're on the SDR command, which gives you structure, there'll
be some additional information that it has integer type of values.
And the initial few values are diddle diddle, diddle diddle.
So both of these are used for the same thing to understand what is the structure of this variable that
we have.
Now let me show you the images so that you get a feel of what kind of data we have here.
We can store the information of one inmate into a variable called F Object.
So when I done this line of code, it will assign the information of the fifth image, all the pixels
into this object.
We just f object.
It's done this.
You can see that F object is a indeed cross to indicate two dimensional.
Containing all depicts a leader of this 5th image.
Now, if you want to block this image, you can then this line of code which has blood function and
block function.
We are telling that we have to block this variable as a Rasta image and studying it is basically up
pixilated image.
So then we've done this line of code.
So here you can see the image on the right.
It's a small twenty eight cross, twenty eight pixel image.
So the image quality is not good, but you can make out the object.
It probably looks like or top if you want to check what it is.
We need to see the image label which is stored in the green label.
We will.
In the train level variable, we saw that the values are in the coded format, that is, it does return
from zero to nine.
So to get the actual name of the class, we first create a class name.
Eddie, this.
Eddie contains the list of names in the order in which we have coded these names.
So zero stands for T.
So if you see nine hit, nine stands for ankle boot, two stands for fluid.
It starts with zero.
This is the second element.
This is the ninth element.
Once we have created this array, we can find out the name of this object, which will take fifth image
in the training labels variable.
So the label of the 50 image plus one, because the recording started with zero, so we just want the
plus Vernetta element from this Eddie.
So let's first create this Eddie and now find out the name of this fifth image.
You can see that the fifty mate is a t shirt slash top.
You can check this again.
But again, that image.
So let's try it out for 90 minutes on this Gomaa 19 Blätter.
I mean, this looks like a sandal.
Not if we take the.
To be a big dick and kick delivered, it comes out to Sandon.
So this is our data.
We have created four variables green images contains all the predictive variables.
Green labels contains the output variable using these two variables.
We will be bringing our model.
Then we will be using that model to predict on the test images.
And we will compare the predictions of the test labels.
The last thing I'm going to discuss in this video is normalization of data.
When we have heterogeneous data, learning model takes a lot of time to converge to handle this problem.
We do normalization of beta to normalize data.
Usually a general formalize.
We subtract the mean of that variable from the even and divided by the standard deviation.
So this is the general formula.
But since our training data is not that heterogeneous, every value is of a pixel having a value between
zero to 255.
So we can just divide all the values in the pixels by 255.
This will result in values between zero to one.
And we can input these values into our training model.
So normalization is required when we have different types of variables in our dataset.
If that is the case.
Use this formula to normalize here since our model is already very homogeneous.
We can just divide the the pixel values by the highest value together.
Simple normalized value.
Now using these draine and test values will be creating a model in the next value.