Welcome back.
Now let's use the feature standard and means in order to make the feature scaling in Android.
So here scroll down scroll down to predict mileage.
And here let's create features with scaling.
So I'm not gonna use this variable that we created before.
I'm going to use another one created here.
And let me name it.
Let me name it as features with scaling.
Change the name with scaling.
And here we go.
Now how to do the scaling.
It's very simple.
As I told you, the general formula is x minus mean over standard deviation.
This is the formula.
Let me apply it here for the cylinders and the other features.
So the first one is the car features dot cylinders minus features mean at index zero which is the cylinders
mean over features standard, which is the index zero which is the cylinders.
Okay.
So x which is the feature minus the mean all over the standard deviation.
Again guys here we are using without scaling.
Here we are using scaling using x minus mean over standard deviation.
Let's do the same for the other.
So let me make here like this.
Android studio will complete it.
Here we go.
So every feature is X.
The minus feature mean which is in the feature means array at index zero and index one, two, three,
and so on all over the feature standard, which is from the standard deviation array at index zero,
one, two, three and so on okay.
So this is our array of features with scaling I need to pass this to the interpreter.
So here features with scaling.
Okay.
Let me run our application again.
Let's run our application again.
Here we go.
Car specifications for cylinders.
Displacement 150.
Power 100 horsepower.
Weight 3015.
Acceleration American and 76 model year predict mpg.
And here we get also out of range 4912.
Maybe there's, uh, something, um, not usual because, uh, the MPG should be 20, 21, 19 in this
range, not this number.
Okay.
If we view the predicted, uh, mpg chart, it should be in this range is the predicted mpg starting
from 910 to, for example, like 35 or 40 maximum, not 4000.
Okay.
So let me figure what's happening here.
And I'm coming back.