No, simple linear regression is a straightforward approach for predicting Y on the basis of a single
predictor variable X.
So if you take only one predictor variable, it is called simple linear regression.
If we assume linear relationship between X and Y, mathematically it can be the DNS.
Y is approximately equal to be does zero plus between X.
It is nearly equal to because the value of Y that our model will give may not be exactly equal to the
value.
In our observation, we'll come back to this talk later here.
Let us select only one variable from the dataset to predict price of the house.
Let's say I choose average number of rooms for this simple model.
So we will regress house price onto the number of rooms by putting the model price is nearly equal to
the zero plus B 11 times.
Room number here.
B, does it go and be done?
Are the unknown items which are known as model, coefficient or model parameters for the particular
case of simple linear regression between is the slope and B does it or is the intercept?
Once we use the training data to estimate these two parameters, because you don't be the one, you'll
be using this hard symbol to denote estimated parameters from our data.
So we will rate prices equal to be does he look at plus bidone gap times, number of rooms.
So for estimating the values of what parameters, we will be using the data points in our dataset.
If you remember, our house pricing dataset has 506 observations.
This number of data points for general purpose will be denoted by an smolan.
So Smolan is 506 for our dataset.
What this means is we have five hundred six pairs of X and Y values.
And our goal is to obtain coefficient estimates.
But does he look up and we have UNCAP such that the linear model fits the available data?
Such as why one gap is equal to be.
Does it all gap plus bidone gap x1.
And if you generalize it for any eye, it is why is nearly equal to B does he look at Lusby, the one
gap excite.
In other words, we want our estimated line to be as close to these points as possible.
One method for measuring this closeness of our line is called the least squared method, which will
discuss No.
Once we done model and get a line, the line will be predicting a value of Y at each point.
I.
This predicted y value will be denoted by y a gap.
Now we do have the actual values of Y at each of these points.
The difference between these actual values and the predicted value is that, Miss.
This is the residual.
And it is denoted by e I as you can see in the graph, using the training data that we had.
We have fitted a line using the B does.
It won't be the one that we calculated.
And this line is drawn here in the blue color.
Each of these points is also plotted.
Some of these points are exactly on the line, but most of them are missing the distance of that point
from the line.
Indeed, as it will at some point, this race is positive at some points.
This is negative when we are taking out the total residual of the sample.
We cannot straightaway sum them up because some are positive and somewhat negative.
Therefore, it will define a new quantity called residual sum of squares.
Now, since Odyssey's is something these squares of Egypt as a tool, it is representing the total error
in this formula.
You can see that for each of the point, we are subtracting the actual observed value from the predicted
value.
And then squaring it.
And we are doing this for all of the points.
Now we have the total error of our predicted lane and we want to minimize this error.
So using calculus and matrix algebra, we will get these formulas, what B does you do and be done for
which this edit is minimized.
So this approach is called Lee Squared Method, because we are minimizing the squared error squared
sum of errors.
So this odysseys value we are trying to minimize.
So by differentiating and putting it to zero, we'll get these values up between gabbin.
But as you look at what this value, what these values will be does zero.
And we done the calculated sum of squares will be minimum.
So we Dumanis summation of X A minus X, but if you remember X bodies did mean of example.
So for each data point, we will find out this difference of each point from its mean.
And then really multiplied with the difference of each y y variable with X mean you'll sum this product
for all the point.
And we're divided by the difference of X from its mean squared reload.
All points similarly.
What does it do?
It is mean value of Y minus between gabb times mean value of X.
So we have mean value of X, I mean value way.
We first need to get laid the B.W. value.
When we put we don't value and this formula will get the B does value.
They're using these formulas for simple linear regression.
You can get these beads, you know, and be the one values.
So for our model, where we selected House Price as VI and room them as X, if I ran this model an assortment,
I get this result.
I have highlighted the beta values in this bluebox.
This intercept is Bieda zero.
And room number is the X variable.
And this is giving the coefficient of this variable.
So this is be done.
So be done.
Is coming out as nine point zero nine and intercept as is coming is minus thirty four point six nine.
In other words, this means that if I increase the number of rooms by one unit, the price of houses
will increase by nine units.
What is the meaning of all these other values that we'll be learning in the coming videos?
One thing to note here is you do not need to remember these formulas because these software packages
will be doing it for you.
As you saw in this video and you will see in the coming videos, we'll be telling you the mathematical
concept behind the theory and discussing those mathematical formulas.
Also, keep in mind that you do not need to remember these formulas.
You just need to understand the concept behind them.
The intuition that I tell you that will help you interpret the result, that understanding of result
is very important.
But you do not need to memorize these formulas since you will be using a software package will which
will be applying all these formulas and getting the results for you to preparing the data is important.
Running a model is important and interpreting the data accurately is the most important.
Remembering formulas is not important in machine learning, no.
Also, even if you do not understand the mathematical part of this, don't be worried.
You can still run a machine learning model and you can use the results in your professional life.
But I highly recommend that you go through all the lectures very carefully to understand the context
behind all these machine learning methods.