Congratulations, guys.
All the evaluation graphs shows that our model is well trained.
Now let's make a prediction here for a new car mileage.
Let me start with a new sample car with four cylinders.
Displacement 150.
Horsepower 100.
Weight 3001 or 15 for acceleration.
Model year 1976.
Origin is from America and set the zeros for European and Japanese.
Okay, this is the sample car.
As I told you before, we need to convert the data that the array that we created here named as new
car.
We need to convert it to a data frame.
So we're going to create new new car data frame.
We need to use the pandas.
Pandas model and library dot data frame and set it to the new car.
So we are converting this array into a data frame with the pandas library and the new car scaled equals
to scalar dot transform new car DataFrame.
This line of code creates a new data frame from your input data.
New car.
The new car creates a new data frame from your input data.
New car and the new car wraps it in a list to ensure proper shape.
Y scalar expects 2D input samples times features.
So this is why we use the data frame to convert this new car, the list or a dictionary to a data frame,
which is a 2D input.
The new car scaled.
We used the scaled because our model was trained on scaled data.
Applies the same scaling that was used on your training data.
Uses the fitted scalar like standard scalar or minimum maximum scalar.
Ensures the new data has the same distribution as training data.
Your model was trained on scaled data.
You should use the scaled data and scalar dot transform.
New predictions must use the same scaling, otherwise prediction will not be inaccurate.
So this is a very important thing.
Now let's make the prediction so predicted MPG equals to model dot predict.
We use the function predict from the model that we trained equals to new car scaled.
That is this scaled parameter okay.
The predicted mpg for the new car will be displaced here.
And here we go.
It's 20.34.
Okay.
So congratulations guys.
We made our prediction.
This is a scaled prediction.
We succeeded in getting scaled parameters.
We transformed those parameters into scaled one.
Then we used them by passing, uh, the new car scaled object to the predict function from the model
and returning the predicted mpg.
Okay, so this is how we get the predictions, how we scale the features, how we scale the parameters
and make them a common and standardized for all functions for all uh, units.
And we get the predicted value correctly.