‫Let's start by importing our BTC.
‫As we've discussed earlier we are going to use defection and my SD dataset to classify images of fashion
‫objects such as those goods boots etc. fashion MONUC Yazdi is a very popular dataset.
‫It is relatively small and is used to verify that an algorithm books as expected are not efficient.
‫Amnesty consists of a training set of sixty thousand examples and a test set of 10000 examples.
‫Each example is a twenty eight by twenty eight 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 in glasses.
‫I'll show 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 the big dataset that comes with us liability.
‫So if the US package is not installed this line more book if it is installed you will get the dataset
‫imported into this video building which is fashion underscored emanate SD.
‫You can see on the right in the environment variable window here exactly does it let us view this dataset
‫by clicking on it.
‫Here you can see that this dataset has to pass grain and test.
‫This means that it is already divided into two parts of planing and pasting.
‫We do not need to do this separately.
‫However if you want to learn how to separate any data set into train and test which is not in this format
‫please take the opening section of this course.
‫There you will find a lecture theatre test train split.
‫With that you will be able to split any day does it make sense.
‫Here are data set is already split.
‫Let's go for the train set for that has two parts X and Y.
‫X is the set of productivity levels and y is the list of output values.
‫That is the class of defection object
‫you can see the structure of X and Y also here X is a set of sixty thousand images.
‫We talked to indeed pixel by two indeed pixels.
‫So for each image we have a value between 0 and 255.
‫If the value is 0 that pixel is black.
‫If it is 255 that pixel is white.
‫So each individual pixels data for all the sixty thousand images is stored in this exhibit even
‫similarly.
‫Why has the glassware lose of 60000 images.
‫For example the first image has the glass nine.
‫What this 90 percent look at that in something similar to the train data we have this data.
‫Only difference is in the training set.
‫We have sixty thousand images data in it.
‫We have 10000 image data.
‫We will use this train data to bring that model.
‫And later on we will predictive y values for this basic using the x values of this data.
‫Then we will compare the actual y values in this test set with the predicted y values from my model
‫to find out the accuracy of our model.
‫Now let's go back to our board will be assigning the x and y brain 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 deplaning set of fashion amnesty variable into the train images.
‫We would however get us allows us to do that in a different way in this format.
‫You can assign the two variables brain images and three labels at the same time.
‫If you run this line of code this will assign the x values of brain to brain images and divide value
‫of brain to train labels.
‫Let's give them this line of code.
‫Now you can see that we have a brain images variable and then labels variable brain images has the X
‫part and bring labels.
‫I did my part.
‫Same goes with the test images and test labels.
‫Next one.
‫This code also and we have two more variables.
‫Although we have seen the structure of training data and this data if you still want to check out the
‫structure of the new variables you can know these two lines of code.
‫Them and within brackets variable name gives you the dimension of this variable to this variable has
‫three dimensions.
‫First is the sixty thousand 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 do do do do do do.
‫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 image into a variable called F object.
‫So when I've done this line of code it will assign the information of the fifth image all the pixels
‫into this object which is f object.
‫Let's end this.
‫You can see that f object is a wounded cross to indicate two dimensional edit containing all the pixel
‫data of this fifth image.
‫Now if you want to plot this image you can then this line of code which has blocked function in plot
‫function.
‫We are telling that we have to plot this variable as a raster image.
‫That estimate is basically a pixilated image.
‫So when we 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 a top.
‫If you want to check what it is we need to see the image label which is stored in the green label variable
‫in the train label variable.
‫We saw that the values are in decoded format.
‫That is it is written from 0 to 9.
‫So to get the actual name of the class B first grade class name.
‫Edit this edit contains the list of names in the order in which we have coded these names so Zito stands
‫for t shirt so if you see nine hit nine stands for ankle boot to stand spot pullover.
‫It starts with D2.
‫This is the second element.
‫This is the ninth element.
‫Once we created this array we can find out the name of this object which all t.
‫Fifth image indeed trainee labels variable so the label of the fifth image plus one because decoding
‫started with 0.
‫So we just want the plus Vernet to eliminate from this edit.
‫So let's first create the setting and now find out the name of this fifth image.
‫You can see that the 50 made is a t shirt slash top
‫you can check this again for an entertainment.
‫So let's try it out for ninth image on this come on my mean slaughtered I mean this looks like a sandal
‫not if we take the liberty
‫to be updated and dig delivered it comes out to it so this is our data we have created for variables
‫dream images contains all the predictive variables dream levels contains the output variable using these
‫two variables will be bringing our model then we will be using that model to predict on the test images
‫and we will compare the prediction of the test levels
‫the last thing I'm going to discuss in this video is normalization of data when we have heterogeneous
‫data a learning model takes a lot of time to converge to handle this problem we do normalization of
‫data to normalize data usually a general formalize we subtract the mean of that variable from that variable
‫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 0 to 255.
‫So we can just divide all the values in the pixels by 255.
‫This will result in values between 0 to 1 and we can input these values into our operating model.
‫So normalization is required when we have different types of variables in a 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 to get the simple normalized value.
‫Now using these train and test values we'll be creating a model in the next 12.