Machine LearningRegression Fundamentals

What is a residual in regression?

A residual in regression is the difference between an observed target value and the value predicted by the regression model.

It tells us how far a prediction is from the actual value for a particular observation.

Residual formula

Residual = Actual value - Predicted value

or:

e = y - ŷ

where:

  • y is the actual target value
  • ŷ is the predicted target value
  • e is the residual

Simple example

Suppose the actual house price is:

₹60 lakh

but the model predicts:

₹55 lakh

Then:

Residual = 60 - 55 = +5 lakh

The positive residual means the model underpredicted the actual value by ₹5 lakh.

What does a negative residual mean?

If:

Actual value = 50
Predicted value = 58

then:

Residual = 50 - 58 = -8

A negative residual means the model overpredicted the target.

What does a residual of zero mean?

A residual of zero means:

Actual value = Predicted value

So the model predicted that observation exactly.

Residuals are available after fitting the model

Once a regression model makes predictions on known observations, a residual can be calculated for each one.

These residuals help us understand where and how the model is making errors.

Residual vs error term

The theoretical regression model contains an unknown error term, representing the true unexplained part of the target.

A residual is the observed estimate of that error after the model has been fitted.

Error term → theoretical and unobserved
Residual   → calculated from actual and predicted values

Why residuals matter

Residuals are useful for checking whether the regression model is behaving as expected.

Patterns in residuals can reveal problems such as nonlinearity, changing error variance, unusual observations, or other model misspecification.

How residuals are analyzed is covered in the next article.

In short, a residual is the difference between an actual target value and the model's prediction for that observation.

#what is a residual in regression#regression residual#residual formula regression#actual minus predicted regression#residual vs error term#machine-learning#regression#residuals#linear-regression#regression-fundamentals

Learning Sequence

Machine Learning Curriculum

45% Completed
Up NextMachine Learning

How do you analyze residuals?

Explore Related Questions

Deepen your understanding across related Machine Learning topics.

Machinoai Logo
Machinoai

Your edge in the AI era. Deep dives into machine learning concepts, paper explainers, verified industry jobs, and developer tools.

© 2026 Machinoai. All rights reserved.