Art of DS

Appearance

Palette
Theme
Unlock $20 one time
Sign in, or create an account

Sign in to Art of DSCreate your Art of DS account

We email you a link and a six-digit code. Either one signs you in; there is no password.Enter your email. We send a link and a six-digit code to confirm it — no password to remember. The account is free.

  • You come back to this page, right where you were.
  • Already have an account? The same email simply signs you in.

By continuing you accept the Terms and the Privacy policy.

Your account

Free accountLifetime access

Metrics & losses · 7 compared

Regression metrics

Definition

Squared, absolute, relative or logarithmic — each regression metric encodes a different belief about what a bad prediction costs, and choosing one is making that claim.

Comparison

Name What it measures Units Outliers Requires
MSE Average squared error. One miss of 10 counts as much as a hundred misses of 1. Full page →target²Highly sensitiveAny real target
RMSE Square root of MSE, so the number reads in the target's own units. Same ranking, readable answer. Full page →targetHighly sensitiveAny real target
MAE Average absolute error. Every unit of error counts the same, whatever its size. Full page →targetResistantAny real target
R² Share of the mean-predictor's error that the model removed. Unitless, but not comparable across datasets — each one's variance sets the scale. Full page →noneSensitive (built on MSE)Non-constant target
MAPE Error as a fraction of the true value. Scale-free and intuitive, and it explodes near zero. Full page →none (ratio)Sensitive to small yy far from zero
MSLE Squared error on logs, so being wrong by a factor costs the same at any magnitude. Full page →none (log ratio)Compresses large yy ≥ 0
Huber Quadratic near zero, linear beyond a threshold. MSE's smoothness with MAE's resistance. Full page →target (δ-dependent)ResistantAny real target

On the cheat sheet: Regression metrics and losses →

One dataset, five verdicts

Run the same four predictions through several of these and they disagree — not about the numbers, but about which mistake mattered:

MetricValue
MSE0.375
RMSE0.612
MAE0.5
MAPE0.327
R²0.948

Those are all y_true = [3, -0.5, 2, 7] against y_pred = [2.5, 0, 2, 8]. The errors are 0.5, 0.5, 0 and 1. Under MSE the single error of 1 contributes two thirds of the total; under MAE it contributes half; under MAPE the error of 0.5 against a true value of −0.5 dominates everything, because relative to that value it is a 100% miss.

Same predictions. Different answer to "what went wrong".

The choice is about cost, not about accuracy

There is no most accurate metric here. Each encodes a claim:

  • Squared (MSE, RMSE, R²) — large errors are disproportionately bad. One 10-unit miss is worse than ten 1-unit misses.
  • Absolute (MAE) — errors cost in proportion to size. Ten 1-unit misses and one 10-unit miss are equally bad.
  • Relative (MAPE, MSLE) — what matters is the factor, not the difference. Being 10% off is equally bad at any scale.
  • Hybrid (Huber) — proportional in the tail, squared near zero, because you want smooth optimisation without outliers steering the fit.

Pick the row that matches how your problem actually loses money, then report the number in units someone can act on.

What each one fits

An under-appreciated consequence: the metric you train on decides what the model predicts.

Minimising squared error fits the conditional mean; minimising absolute error fits the conditional median; minimising MSLE fits something closer to the geometric mean of 1 + y [2, §6.2.1.2]. On right-skewed data these are noticeably different numbers, so an MAE-trained model sitting lower than an MSE-trained one is behaving correctly, not underfitting.

Practical advice

Report two: one absolute number in the target's units so people can act on it (RMSE or MAE), and R² for the share of variance explained — on this dataset only, since R² is not comparable across datasets either. Never report MSE alone — its units are the target squared, which no one can interpret [1, return value].

Check min(abs(y_true)) before choosing MAPE and min(y_true) before choosing MSLE. Both have domain restrictions that turn them from useful into meaningless without warning.

Sources

  1. scikit-learn — sklearn.metrics.mean_squared_errordocs · retrieved 2026-08-30https://scikit-learn.org/stable/modules/generated/sklearn.metrics.mean_squared_error.html
  2. Goodfellow, Bengio, Courville. Deep Learning (2016)bookhttps://www.deeplearningbook.org/contents/mlp.html

Have a promo code?

A code that takes 100% off unlocks everything at once. A smaller one takes its share off the price in the payment window: enter the same code there.

Write to support

A question, a problem with access, a refund? Write to us and we answer by email.

What is it about?

Your address is used only to answer you.

Message sent

Thank you. We will reply to the address you gave, by email.

Or write to us directly

support@artofds.com

Message sent Thank you. We will reply to the address you gave, by email.

Check the email address: we need it to reply.

That is our own address. Enter yours, so the reply reaches you.

This address cannot receive email. Check it for a typo.

Write a little more: at least 10 characters.

Too many messages in a short time. Try again in a few minutes.

The message could not be sent. Please write to us directly: support@artofds.com