L
Linear Regression

Linear Regression

Linear regression models the relationship between a dependent variable and one or more independent variables using a straight line. It assumes that changes in the input variables produce proportional changes in the output. Simple linear regression uses one predictor variable (y = mx + b), while multiple linear regression uses several predictors. The algorithm finds the best-fitting line by minimizing the sum of squared differences between predicted and actual values.

Linear regression works well when relationships are truly linear and assumptions about data distribution are met. It's highly interpretable since coefficients directly show how much each input variable affects the output. Common applications include predicting house prices based on size, estimating sales from advertising spend, and analyzing economic relationships. However, it struggles with complex, non-linear patterns and is sensitive to outliers.