Skip to content

Regression Metrics

Ways to score predictions of numbers: average error size (MAE), average squared error (MSE, RMSE), and the share of variation explained (R²).

Also MSE · MAE · RMSE · R² · R squared · coefficient of determination · mean absolute error

Fig. / How it works
MAE AND MSE AVERAGE THE GAPS
Domain 01
Foundations
Role · kind
Evaluating and testingMetric
Level
Beginner

If you guess how many sweets are in jars, MAE is how far off you are on average. R² says how much better you are than someone who always guesses the average jar.

Where it fits

+All relationships as a list

See it on the full map

How it works

Accuracy and precision and recall are for categories. When a model predicts a number, such as a price, a temperature or a delivery time, we measure how far off it is:

  • MAE (mean absolute error): the average size of the error. “Off by 18,000 on average.”
  • MSE (mean squared error): the average squared error. This is also the usual loss for linear regression; squaring punishes big misses heavily.
  • RMSE: the square root of MSE, back in the original units, still sensitive to large errors.
  • R²: how much of the variation in the target the model explains, compared with always predicting the average. 1 is perfect, 0 is no better than the average, and it can even be negative for a model that is worse than that.

Which one to report depends on what errors cost. If one disastrous miss is much worse than several small ones, RMSE reflects that; if every unit of error costs the same, MAE does.

The mathMAE=1n∑∣yi−y^i∣,R2=1−∑(yi−y^i)2∑(yi−yˉ)2\text{MAE} = \frac{1}{n}\sum |y_i - \hat{y}_i|, \qquad R^2 = 1 - \frac{\sum (y_i - \hat{y}_i)^2}{\sum (y_i - \bar{y})^2}

Everyday use cases

  • Case 01

    House price models

    "Off by 18,000 on average" (MAE) is easier to explain than a squared error.

  • Case 02

    Comparing forecasts

    R² tells you whether a demand model beats simply predicting last year's average.

Strengths, weaknesses and when to use it

Strengths

  • MAE and RMSE are in the same units as what you predict, so they are easy to explain.

Weaknesses

  • R² can be misleading on its own (it rises with more features and says nothing about bias).
  • A single number hides where the model fails.

When to use itFor any model that predicts numbers; report an error in real units (MAE or RMSE) plus R².

Compare with

Check yourself

  1. Q01

    Which metric is least affected by a few huge errors?

    Show answer

    B: MAE

  2. Q02

    What does an R² of 0 mean?

    Show answer

    A: The model is no better than always predicting the average

Go deeper

Learn first