WEBVTT

00:00.080 --> 00:00.960
Welcome back.

00:01.200 --> 00:05.320
We calculated the metrics MSE and R squared score.

00:05.560 --> 00:14.080
Now let's create a scatter plot with regression line to visualize how well your model fits the test

00:14.080 --> 00:14.680
data.

00:14.720 --> 00:20.240
Okay, so at first let me start with PLT dot figure.

00:20.360 --> 00:22.720
Figure size is 8.5.

00:22.760 --> 00:24.880
Let me create a scatter.

00:25.080 --> 00:29.400
So eight by five eight inches wide and five inches tall.

00:29.440 --> 00:40.920
Plot scatter x test y test color blue and label actual and another scatter x test y predict.

00:40.960 --> 00:51.600
You see guys, I am using Xtest input feature and y test which is the actual target values.

00:51.840 --> 00:54.240
Then I used x test.

00:54.240 --> 00:59.080
And why predict y predicts for model's predictions.

00:59.400 --> 01:03.920
Okay, so Plitt predicted values as red x marks.

01:03.920 --> 01:06.440
So here we have red.

01:06.480 --> 01:08.960
Let me make a note.

01:09.080 --> 01:16.040
This plots the predicted values as red x marks and here as blue dots.

01:16.280 --> 01:19.480
So the actual values are in blue.

01:19.720 --> 01:23.280
The predicted values are in red.

01:23.320 --> 01:23.720
Okay.

01:23.760 --> 01:34.000
So we're going to display a graph that gives us the red dots as predicted and the blue dots as actual.

01:34.000 --> 01:45.280
And we're going to see the difference and how well the predicted is similar or is closer or is far or

01:45.360 --> 01:48.760
different from the actual data.

01:48.920 --> 01:59.240
Then plotting start plotting with X, test y predict color red line width two and label fitted line.

01:59.280 --> 02:07.280
This connects predicted values with a red line and shows the regression line curve that your model learned.

02:07.320 --> 02:12.120
Now let's add the title and the label for our graph.

02:12.280 --> 02:13.360
Plot title.

02:13.360 --> 02:19.880
Actual versus predicted prices x label size square 1000 square meter.

02:19.920 --> 02:29.560
Plot the y label y axis as the price and plot legend grid true and show the plot.

02:29.600 --> 02:32.120
Let's run and here we go.

02:32.240 --> 02:35.320
This is our amazing result.

02:35.360 --> 02:37.600
The red line is the predicted.

02:37.600 --> 02:39.320
You can see the legend here.

02:39.360 --> 02:50.360
Red line is the predicted actual price is the blue dots as the points evenly distributed around the

02:50.360 --> 02:50.880
line.

02:51.200 --> 02:53.840
Also clear linear relationship.

02:54.000 --> 03:03.090
And as the blue dots close to the red line as you get a good fit and a good result.

03:03.090 --> 03:10.730
So as those line, close those blue dots closer cut.

03:10.770 --> 03:12.050
We have this legend.

03:12.050 --> 03:18.530
Actual dots are in blue that predicted in in X and the fitted line here.

03:18.530 --> 03:24.730
So as we get closer to the red line as we get a good fit.

03:24.730 --> 03:33.290
So the blue lines actual close to red line, which is the predicted points evenly distributed around

03:33.290 --> 03:36.690
the line and clear linear relationship.

03:36.690 --> 03:38.490
This is a good result.

03:38.490 --> 03:43.370
So here I want from you to understand this note.

03:43.370 --> 03:48.050
For the good results you should get for good results.

03:48.050 --> 03:54.610
As I told you, you should get the blue dots close to the red line.

03:54.610 --> 04:03.210
So you can see those blue dots are close to the red line points evenly distributed around the line.

04:03.210 --> 04:09.250
Also we have evenly distributed points clear linear relationship.

04:09.250 --> 04:13.050
So we can see that we are following linear line.

04:13.050 --> 04:14.610
So this is the straight line.

04:14.610 --> 04:19.610
If we get blue dots far from red line.

04:19.650 --> 04:30.450
Curved pattern in residuals points clustered in certain areas you get poor fit and bad results.

04:30.650 --> 04:40.610
So you should get those symptoms, those indications, the blue dots close to red line points evenly

04:40.610 --> 04:48.810
distributed around the line, and the clear linear relationship in order to get a good result for your

04:49.050 --> 04:49.610
model.
