
So, it is very essential to update the value of Øo and Øi in case of multiple regression and the value of Øo and Ø1 in case of simple linear regression, to reach the best value that minimizes the error between the predicted value and true value. It does this by comparing the predicted values of the hypothesis with the actual true value.īy achieving the best-fit regression line, the model aims to predict the ‘y’ value such that the error difference between the predicted value and the real value is minimum. The cost function measures the accuracy of the hypothesis outputs. This is done by the so-called cost function. The best fit line is determined by tuning the values of Øo and Øi such that the sum of the square of predicted and real value is minimal.Īfter we’ve trained our learning algorithm and got a hypothesis, we need to examine how good our results are. Øi = Slope coefficient for each of the dependent variables, i = 1,2,3. The formula used to develop the relationship between dependents and independent variables is: It also develops the linear relationship between dependent and independent variables. This output variable is dependent upon more than one variable so has been named multiple linear regression. Generally, the independent variables are more than one rather than just one variable. Once the best Ø1 and Ø2 are available, the model is ready to predict the output for the corresponding input. In other words, the sum of the distances from that line to the points is minimal. The best-fit line is the line that is drawn such that the sum of the square of the distance between the predicted value and the true value is minimal. The simple regression model tries to find the ‘best-fit line’ (blue-colored line in the figure above) by adjusting the slope(Ø2) and the intercept(Ø1). The formula used in simple linear regression to find the relationship between dependent and independent variables is: In simple linear regression, the independent variable is only one. Depending on the number of independent variables, linear regression is of two types :

It is used to develop the relationship between variables and forecasting. Regression models the target predicted variable based on independent variables. This model maps the linear relationship between dependent and independent variables, so have named linear regression. Linear Regression is a machine learning model that is based on supervised learning.
