Linear Regression

Linear regression draws a straight line through dots so it can guess a number.

What it does

Linear regression draws a straight line through dots so it can guess a number.

Regression: Predicting a number • Fit: How close the line is

How it works

  • Put the example dots on a chart.
  • Draw a line that stays close to the dots.
  • Use the line to guess a new number.

Uses and applications

  • A weather app can guess tomorrow’s temperature from past temperatures.
  • A home website can estimate a house price from size and location.
  • A growth chart can estimate a child’s height at a future age.

In short

It predicts numbers by drawing a best-fit line, like a growth chart.

Related methods

  • Logistic Regression: Uses a similar weighted sum, but turns it into a chance for a yes-or-no answer.
  • ARIMA: Also a linear model, applied to values ordered in time.

Back to Prediction and classification · All topics

The interactive demonstration and the Python walkthrough for this topic need JavaScript.