So now we have imported our data.
We have imputed the missing values.
We have created dummy variables for our categorical variables and we also have divided over data and
do X and Y and has Centerin.
Now, the next step is to centralize our data.
What do we mean by standardizing?
It means that we will convert the mean and variance of each of the variable to be zero and one respectively.
So we will try to convert our variables in such a way that the mean of all the variables should be zero
and we will try to convert their variance as one.
So we want to transform each variable by multiplying.
Or adding some value to get zero as mean and one as variants.
Now, there is no need to manually compute this numbers.
The multiplier or the addition value.
There is a separate function in a scale on that, but you do the same thing for all the variables.
Now, standardizing is very important because SVM can only give us correct reserved when we centralize
our data, since in SVM we are calculating distance and distance.
Depends on the scale of each variable.
So suppose if you are using one variable with is skills of posing.
So the values are like 2000, 3000, 5000, etc. and there isn't another variable in which the scales
is in decimal.
So suppose point one point two point three point four, etc..
So when we are calculating the census, we should use the same scale for these two variables.
Since if we do not standardize our data, the impact of the variable with larger scale will be much
more than the impact of the variable with a smaller scale.
So it is very important to standardize our data before running as a model.
So there are several ways to standardize our data.
The first one is to use the standard is scalar in which we will transform the mean of all the variables
and variance to be one.
Another way is to use min max scalar and which we will transform each variable so that the lowest value
of each variable is zero and the highest value of each variable is one.
You can use either of these two, but in this course we will discuss the standard scale at.
I have provided the link of a standard Schallert function of a Skillern.
You can use this link to learn more about this.
So this is the Skillern official documentation of a standard scale.
We are not discussing this in detail.
But here you can find all the parameters and all the attributes of.
This centered skill at function.
So standardizing using a Skillern is very easy for us.
We will import the standard scalar function.
Then we create our scalar object using our X data.
So here we are using Ascender Discolor function.
And then we're fighting over ex data.
And this is standard escala function.
And we are assigning this object to a variable name at C.
So now this AC will contain the information or the transformation for each of the variable.
No Exadata, we can use this at sea to transform what Ekstrand data.
So we are creating another variable that is extreme, underscore the standard and we are using at sea.
And then we are using transform method of at sea to transform this Ekstrand data.
So my at Segunda and all the information that we need to transform our data.
And we are using DOT Transformatory to do this.
We lose similar method for expressed also.
We will create X, underscore tests, underscore sender and we will use at sea and the transform method
to transform X data.
So now might as standardized data them.
These two variables.
There is no need to standardize Vibert Abels, since we are predicting the value of Y.
We only need to standardize our X data.
Now.
If you look at the values of Express's standard, you can see all of my values are in decimal points,
why we are getting decimal points because we have converted our meaning to zero and variance to one.
If I compare this values with a word X test in do to say.
So here you can see that the scales of values are different.
The marketing expense are in tens and hundreds.
The multiplex coverage is in the form of decimal point.
But here, if you see our the data of.
Uniform is scale, all the values are in decimal.
We will use over a standardized data to train our more than.