WEBVTT

00:00.120 --> 00:01.000
Welcome back.

00:01.000 --> 00:09.040
Now let's use the feature standard and means in order to make the feature scaling in Android.

00:09.280 --> 00:14.440
So here scroll down scroll down to predict mileage.

00:14.440 --> 00:19.960
And here let's create features with scaling.

00:20.120 --> 00:24.920
So I'm not gonna use this variable that we created before.

00:25.240 --> 00:29.240
I'm going to use another one created here.

00:29.240 --> 00:30.960
And let me name it.

00:31.000 --> 00:37.080
Let me name it as features with scaling.

00:37.240 --> 00:40.480
Change the name with scaling.

00:40.600 --> 00:41.640
And here we go.

00:41.680 --> 00:44.160
Now how to do the scaling.

00:44.160 --> 00:45.800
It's very simple.

00:46.080 --> 00:55.880
As I told you, the general formula is x minus mean over standard deviation.

00:56.000 --> 00:57.200
This is the formula.

00:57.440 --> 01:03.240
Let me apply it here for the cylinders and the other features.

01:03.240 --> 01:14.280
So the first one is the car features dot cylinders minus features mean at index zero which is the cylinders

01:14.280 --> 01:22.470
mean over features standard, which is the index zero which is the cylinders.

01:22.510 --> 01:22.990
Okay.

01:23.030 --> 01:31.110
So x which is the feature minus the mean all over the standard deviation.

01:31.150 --> 01:35.110
Again guys here we are using without scaling.

01:35.110 --> 01:40.750
Here we are using scaling using x minus mean over standard deviation.

01:40.750 --> 01:43.190
Let's do the same for the other.

01:43.350 --> 01:46.830
So let me make here like this.

01:46.870 --> 01:48.830
Android studio will complete it.

01:56.430 --> 01:57.150
Here we go.

01:57.430 --> 02:00.430
So every feature is X.

02:00.750 --> 02:10.630
The minus feature mean which is in the feature means array at index zero and index one, two, three,

02:10.630 --> 02:19.670
and so on all over the feature standard, which is from the standard deviation array at index zero,

02:19.710 --> 02:22.190
one, two, three and so on okay.

02:22.470 --> 02:32.590
So this is our array of features with scaling I need to pass this to the interpreter.

02:32.870 --> 02:36.630
So here features with scaling.

02:36.750 --> 02:37.350
Okay.

02:37.390 --> 02:40.110
Let me run our application again.

02:40.190 --> 02:42.230
Let's run our application again.

02:42.270 --> 02:43.070
Here we go.

02:43.270 --> 02:45.990
Car specifications for cylinders.

02:46.030 --> 02:47.590
Displacement 150.

02:47.750 --> 02:50.550
Power 100 horsepower.

02:50.750 --> 02:53.390
Weight 3015.

02:53.430 --> 02:58.550
Acceleration American and 76 model year predict mpg.

02:59.030 --> 03:05.350
And here we get also out of range 4912.

03:05.390 --> 03:16.230
Maybe there's, uh, something, um, not usual because, uh, the MPG should be 20, 21, 19 in this

03:16.230 --> 03:18.070
range, not this number.

03:18.110 --> 03:18.550
Okay.

03:18.710 --> 03:28.110
If we view the predicted, uh, mpg chart, it should be in this range is the predicted mpg starting

03:28.110 --> 03:35.990
from 910 to, for example, like 35 or 40 maximum, not 4000.

03:36.030 --> 03:36.470
Okay.

03:36.670 --> 03:40.430
So let me figure what's happening here.

03:40.430 --> 03:42.110
And I'm coming back.
