In simple linear regression, we have a single input feature (independent variable) and a target variable (dependent variable). The goal is to find the best-fit line, represented by the equation:
Here, y is target variable, x is input feature, m is slope of the line, and b is y-intercept.
The best-fit line is determined using least squares method, which minimizes the sum of the squared differences between the actual data points and the values predicted by the line.
Where to Use: Linear regression is used when you want to establish a linear relationship between one or more independent features and a continuous target variable. It’s suitable for predicting values within a range.
Why to Use: Linear regression is simple and interpretable. It’s a good choice for problems like predicting housing prices, stock market trends, and economic modeling.