AI glossary

Linear regression

In one sentence Linear regression predicts a number by drawing the best straight-line relationship between the inputs and the output.

By Updated

Linear regression predicts a number as a weighted sum of the inputs — the straight-line relationship that best fits the data.

Every auto driver carries one in his head: fare equals a flat charge plus so-much per kilometre. Two numbers — the base and the per-km rate — turn any distance into a fare estimate. Linear regression learns those numbers from data, and extends the idea to many inputs: a flat's price as (weight × area) + (weight × distance to metro) + (weight × age) + base.

"Best fit" has a precise meaning: the weights that minimise the squared differences between predictions and actual values. For this one model the answer even has a closed formula, though libraries and gradient-descent reach the same place.

price ≈ 9,200 × sqft  −  310,000 × km_to_metro  +  1,100,000
        each weight is readable: one more km from the metro costs ₹3.1 lakh

That readability is the enduring superpower — each weight states its feature's effect in real units, which is why economics, medicine and pricing teams still live on this model. It is also the mandatory first baseline for any regression problem: if a deep model cannot beat it, the deep model is not earning its complexity. Its limits are honest ones: straight-line effects only, and sensitivity to extreme outliers, which squared error magnifies.

Where to go next