Welcome back.
After we learned about the Mae and MSE and evaluated our model.
Now let's make predictions here.
Start with predictions equals to model predict x test scaled dot flatten.
I need to plot it on diagram.
So let's visualize the predictions versus the actual values.
Plot figure.
We need to create a figure eight by six the scatter y test predictions and alpha 0.5.
We can make it like seven to better understand it.
Also, we talked about those in the previous videos, so please go back to the previous videos in order
to get more data about them.
But they are very, very simple.
We are using the Matplot library by using plt plt, dot figure, dot scatter.
And here let me set the x label and y label the actual mpg.
The y label predicted mpg and the title actual versus predicted mpg.
Also, we need to uh, the plt dot plot.
It is the very important thing y test because we are testing the we are getting the tested once y test
maximum Y test minimum, Y test maximum and k minus minus and L2.
Okay.
Those are very simple for creating the the plot and the graph.
Make it tight layout.
And don't miss to use the show function to show it.
Let's run and here we go.
This is our model.
Okay.
This is our diagram that gives us the actual data and the predicted label, the actual data and the
predicted mpg.
You can see that those points are actual.
And the predicted line is this.
Okay so congratulations guys.
The the line is shown here.
R is close to the points.
And those points are close to the the straight line here.
And this gives us an indication that our model is well trained.
And we get the correct predictions and near predictions.
So this is a very important analysis of the model that it is trained.
And this is a good indication that the data are grouped near the approximately near the straight line.