Simple linear regression using OLS
We will study one of the simplest machine learning models – simple linear regression. We will provide its overview within the context of OLS, where the objective is to minimize the sum of the square of errors. It is a straightforward concept related to a dependent variable (quantitative response) y and its independent variable x, where their relationship can be drawn as a straight line, approximately. Mathematically, a simple linear regression model can be written in the following form:
y = β 0 + β 1 x + ϵ
Here, β 0 is the intercept term and β 1 is the slope of the linear model. The error term is denoted as ϵ in the preceding linear model. We can see that in an ideal case where the error term is zero, β 0 represents the value of the dependent variable y at x = 0. Within the range of the independent variable x, β 1 represents the increase in the outcome y corresponding...