Linear regression is a kind of curve-fitting and prediction algorithm. It is used to discover the linear association between a dependent (or target) column and one or more independent columns (or predictor variables). This relationship is deterministic, which means it predicts the dependent variable with some amount of error. In regression analysis, the dependent variable is continuous and independent variables of any type are continuous or discrete. Linear regression has been applied to various kinds of business and scientific problems, for example, stock price, crude oil price, sales, property price, and GDP growth rate predictions. In the following graph, we can see how linear regression can fit data in two-dimensional space:
The main objective is to find the best-fit line to understand the relationship between variables with minimum error. Error in regression is the difference between the forecasted and actual values. Coefficients of regression are estimated using...