Welcome back.
We get out of range.
Impossible.
Predicted mileage.
And this is wrong.
This is due to wrong feature order, wrong scale constants or data entry bug.
Let me check the feature order and constants.
So let me go back to the car features.
Split the screen and here we have the order.
Let me check the order with scaling features.
Cylinder displacement.
Horsepower weight.
They are the same acceleration.
Then model year, then origin one, two and three.
Acceleration model year, origin one, two and three.
Those for the standard deviation and the mean.
So here cylinders.
Displacement.
Horsepower.
Weight.
Acceleration model year one two and three.
And those are the same.
Okay.
So the order is not the problem.
Let's see the input data.
So let's scroll down to here for the statistical summary.
And let me put it like this.
The statistical mean for cylinders 5.47.
Displacement one nine for horsepower one zero.
For weight 2977.
And acceleration.
The acceleration is the error.
So here we get the error of 15.5.
For the model year is 75.
The origin is 1.57.
Let me check the feature standard.
So you see guys that any error your data will be missed and the model will be generating random and
wrong predicted data.
The standard for the first
1.710438849, 2.7, 3.6 and 0.8.
So this is good for our application.
Now let's run our application again.
And by the way you can debug the data.
So scroll down to here in the Predict mileage.
Let me debug the data the scaled data.
So debugging the scaled features let me log scaling cylinders features.
With scaling you can put like this.
Or you can print all the features.
So print LN scaled features features with scaling dot for each indexed go and set the index and the
value.
Print the feature and the index.
Let's run our application.
Here we go.
This is our application open.
Look at clear.
Look at.
And here we have the data entered predict MPG.
And here we get a new value and it's acceptable.
So now it's 34 mpg.
Let's select European predict mileage.
It's 25.
Let's select Japanese and predict the MPEG and it's working fine.
Let's go back to American.
Let's predict the features.
And here we get the scaled features zero -0.83.
Let's compare them with our Google Colab.
So here if we take the same sample new car four cylinders 150 100 horsepower, 3015 acceleration and
model year 76 origin American run.
It will give me 20.54.
And this is a big difference between our application.
Those are similar to what we've done.
Select American predict and it's 34.
And this is a big problem.
Maybe there is here in the standard deviations and the mean we need to modify those origins because
the features are the same guys.
So here we have a lot of features.
The first six features are same as before.
We need to configure the origin.
So let me test again with this code.
So here under this go and start anew and paste X train origin one, origin two and origin three.
Get the mean and the standard deviation of them.
And here we go.
We get the standard deviation and the mean of them.
So those are for the standard deviation.
Let me correct them.
So here the standard deviation.
Replace it by this.
Then this and this.
Also we need to correct the mean.
Now our mission to get the feature means here if we see guys that the problem is origin are of integer.
And we splitted the origin to three columns.
So we need to get the data from the three columns, not from the one column.