Overview
Direct Answer
Linear regression is a supervised learning algorithm that models the relationship between a dependent variable and one or more independent variables by fitting a straight line (or hyperplane in multiple dimensions) through observed data points. It assumes a linear relationship and estimates coefficients that minimise prediction error.
How It Works
The algorithm calculates optimal coefficients by minimising the sum of squared residuals—the differences between observed and predicted values. In simple regression, a single independent variable produces a 2D line; multiple regression uses the normal equation or gradient descent to solve for coefficients across n-dimensional space. The fitted model then makes predictions by applying the learned coefficients to new input data.
Why It Matters
Linear models are computationally efficient, interpretable, and require relatively small datasets, making them valuable for rapid prototyping and regulatory compliance in finance and healthcare. Their transparency—each coefficient's magnitude directly indicates variable importance—supports evidence-based decision-making where stakeholders must understand model behaviour rather than treat it as a black box.
Common Applications
Applications include sales forecasting based on historical trends, real estate price estimation from property features, medical outcome prediction (e.g., patient recovery time), and demand planning in supply chain operations. Financial institutions use it for credit risk assessment and cost-benefit analysis.
Key Considerations
The method assumes a genuine linear relationship; non-linear data produces poor predictions. Multicollinearity between independent variables, outliers, and heteroscedasticity (non-constant error variance) can degrade model performance and interpretability.
More in Machine Learning
Reinforcement Learning
MLOps & ProductionA machine learning paradigm where agents learn optimal behaviour through trial and error, receiving rewards or penalties.
Overfitting
Training TechniquesWhen a model learns the training data too well, including noise, resulting in poor performance on unseen data.
Collaborative Filtering
Unsupervised LearningA recommendation technique that makes predictions based on the collective preferences and behaviour of many users.
Ensemble Learning
MLOps & ProductionCombining multiple machine learning models to produce better predictive performance than any single model.
Continual Learning
MLOps & ProductionA machine learning paradigm where models learn from a continuous stream of data, accumulating knowledge over time without forgetting previously learned information.
Catastrophic Forgetting
Anomaly & Pattern DetectionThe tendency of neural networks to completely lose previously learned knowledge when trained on new tasks, a fundamental challenge in continual and multi-task learning.
A/B Testing
Training TechniquesA controlled experiment comparing two variants to determine which performs better against a defined metric.
Ensemble Methods
MLOps & ProductionMachine learning techniques that combine multiple models to produce better predictive performance than any single model, including bagging, boosting, and stacking approaches.