What Is Linear Regression? A Plain-Language Explanation

Updated · By Viviai

Linear regression is a supervised learning method that predicts a number by fitting a straight-line relationship between one or more input variables and a continuous output, such as a house price or a temperature.

The simple analogy

Think of plotting points on graph paper and drawing a single straight line through them so the line sits as close to all the points as possible. That line is the model, and you can use it to guess the answer for a new point.

How the line is chosen

A line with one input has the form Y = a + bX, where b is the slope and a is the intercept. The algorithm adjusts these values to minimize the squared differences between predicted and actual values, a measure called the residual sum of squares.

One input versus several inputs

Type Number of inputs Example
Simple linear regression One Predict price from house size
Multiple linear regression Two or more Predict price from size and bedrooms

Where it is commonly used

Linear regression is used for forecasting demand, estimating sales, analyzing trends, and any problem where the answer is a quantity rather than a category.

Honest caveats

A straight line assumes a roughly linear relationship. If the true pattern is curved, or a few extreme points dominate the data, the predictions can be misleading, so checking a scatterplot and the residuals is a useful step.

FAQ

Is linear regression classification or regression?

It is a regression method because it predicts a continuous number, not a category label.

What does the slope represent?

The slope shows how much the predicted output changes for each one-unit change in the input.

What is a residual?

A residual is the gap between the actual value and the value the line predicts.

Can linear regression use more than one input?

Yes, using several inputs is called multiple linear regression.

Key takeaways

Continue with what is logistic regression and what is supervised learning.

Sources

  1. http://www.stat.yale.edu/Courses/1997-98/101/linreg.htm
  2. https://khoury.northeastern.edu/home/vip/teach/MLcourse/1_intro_DT_RULES_REG/lecture_notes/linear_regression.pdf
  3. https://introml.mit.edu/_static/fall25/lectures/lec01/introml-fa25-lec01.pdf

Learn by doing

Read a guide, then practice with bite-sized AI lessons you can take offline.

Start learning free