What is Linear Regression in Machine Learning

In this short blog, I will go through what linear regression is and how it is applied in the field of machine learning.

7at
2 min readDec 6, 2020
Figure 1: Image of linear regression taken from Merchant Maverick

Linear Regression (LR):

Linear Regression is a statistical term that defines the relationship between two or more variables (one dependent and one or more independent) by using equation of line.

Y = mX+c

where m is the slope of line and c is y-intercept.

LR in Machine Learning(ML):

In ML, when you train your model then LR finds you the parameters that make the linear model fit best to your data.
It attempts to model the relationship between the variables by fitting a linear equation to the observed data. The line is fitted by either translation or rotation.

Y = MX + C

where m, slope controls the rotation of line and C, intercept controls the translation of line.

Figure 2: Image of fitting model taken from Machine Learning and Data Science

Another term that comes after that is Loss. Loss is the difference between the predicted value of a variable and the actual value.

For LR problems, one solution of loss is by using a cost function that measures the distance between the linear model’s predictions and the training examples; the objective is to minimize this distance.

References

Book by Aurelien Geron “Hands on Machine Learning with Scikit-Learn and TensorFlow”

--

--