Specialty Digest

Global English editionLearners’ Study Dashboard — in development
The Knowledge Library for All

Flashcards: open the module flashcards (end-of-module review with workplace questions).

Online Courses / University Track / Learning from Data

Module 2 · Lesson 2 · Core

Summarising error: MAE and RMSE

Average the errors of many predictions with mean absolute error and root mean squared error.

  • 50 minutes
  • Serves O2
  • Assumes M2.L1

Phase 1: Prepare

Step 1 Warm-up recall

From M2.L1: why do signed errors cancel?

Private: nothing you type here is sent or stored.

Step 2 Learning goal

By the end of this lesson you can:

  • compute mean absolute error by hand (Foundation);
  • compute root mean squared error by hand (Core);
  • say when RMSE and MAE differ and why (Core).

Phase 2: Teach

Step 3 A familiar example

A teacher marks five scripts and wants one number for how far her predicted grades were from the real ones. She averages the gaps. That average is the mean absolute error.

Step 4 Clear explanation

The mean absolute error (MAE) is the average of the absolute errors. In the invented table below the model's absolute errors are 10, 5, 10, 5 and 10, which total 40, so MAE = 40 ÷ 5 = 8 (thousand pounds). The baseline, which always predicts the mean of 240, has errors 40, 20, 0, 20 and 40, total 120, so its MAE is 24.

HomeActualModelModel abs. errorBaseline (mean 240)Baseline abs. error
A2002101024040
B220215524020
C240250102400
D260255524020
E2802901024040
Model (MAE)8Baseline (MAE)24Invented example: five homes, £ thousands. Lower is better
Invented example: mean absolute error for the model and for the always-predict-the-mean baseline on the same five homes.

The root mean squared error (RMSE) squares each error, averages the squares and takes the square root. For the model: 100, 25, 100, 25 and 100 total 350; ÷ 5 = 70; the square root is about 8.4. Squaring means big errors count much more, as the next table shows.

Errors (five cases)Mean absolute errorRoot mean squared errorWhat it shows
2, 2, 2, 2, 222every error the same size, so the two agree
2, 2, 2, 2, 124about 5.7one big miss lifts RMSE much more than MAE
Share of total, absolute60%Share of total, squared90%Errors 2, 2, 2, 2, 12: the 12 is 12 of 20 absolute and 144 of 160 squared
Squaring makes big errors count much more. One error of 12 adds 144 to the squares, but only 12 to the absolute errors.

Use MAE when every unit of error costs about the same. Use RMSE when large misses are especially harmful, as with a flood level or a drug dose. Whatever you pick, say which it is, because the two give different numbers for the same model. Both are in the units of the label, so 8 means eight thousand pounds, not 8 percent.

Step 5 Worked example (4 marks)

A model's errors on four cases are +2, −3, +1 and −4. Find MAE and RMSE.

  1. Absolute errors: 2, 3, 1, 4; total 10; MAE = 10 ÷ 4 = 2.5. (1 mark)
  2. Squares: 4, 9, 1, 16; total 30. (1 mark)
  3. Mean of squares = 30 ÷ 4 = 7.5; RMSE = √7.5 ≈ 2.74. (1 mark)
  4. Answer: MAE 2.5 and RMSE about 2.7; RMSE is larger because of the 4. (1 mark)

Go deeper: the professor's notes

Choose the measure to match the cost of a miss: MAE for steady costs, RMSE when large misses are worse.
MAE

Average size.

RMSE

Big misses count.

Units

Of the label.

Errorsmany casesAbsoluteor squaredAveragemeanReportwith units
Summaries

Choice

Cost of a missMeasure
proportionalMAE
rises sharply with sizeRMSE

At work: A forecast

A late delivery costs more than an early one.

  1. Decide which misses are worst.
  2. Choose RMSE or a weighted loss.

What a careful practitioner decides. The measure should reflect what a mistake really costs.

Phase 3: Practise

Step 6 Learner practice (instant-marked)

1. MAE is the:

2. Errors 1, 3, 5 give a mean absolute error of:

3. RMSE is more affected than MAE by:

4. If MAE for house prices is 8 (in £ thousands), the typical miss is about:

Phase 4: Close

Step 7 Recap

  • MAE averages the absolute errors.
  • RMSE squares, averages and takes the root, so big errors count more.
  • Both are in the units of the label; say which you used.

Step 8 Exit ticket (ungraded)

Errors are 1, −1, 2 and −2. Find the MAE.

Private: nothing you type here is sent or stored.

Step 9 Go further (Extension)

Find a case where the choice of MAE or RMSE would change which of two models looks better.

In industry: Netflix Prize: the last gap

The winning team in September 2009 reached 0.8567 on the test set, an improvement of 10.06 percent on the company's system, which was just enough to meet the target.

Link to this lesson. A small number of decimal places can decide a contest, so the measure and the data it is computed on must be fixed beforehand.

Source: Feuerverger, He and Khatri (2012), Statistical Significance of the Netflix Challenge

Common mistakes

MistakeWhy it fails
Forgetting to divide by the number of casesIt is a mean.
Forgetting the square root in RMSERoot of the mean of squares.
Quoting a bare number without unitsSay pounds, minutes or percentage points.

Limits. Other loss measures exist, for example for percentages; this lesson uses the two most common.

Flashcards for this lesson (3)

Tap a card to reveal the answer. Read the question, answer it aloud or in writing first, then check yourself against the explanation.

Card 1 of 3 · What is mean absolute error (MAE)?
Addabs errorsDivideby countUnitsof label
MAE

The average of the absolute errors. If five homes are missed by 10, 5, 10, 5 and 10 thousand, MAE is 8 thousand. It is in the units of the label.

Card 2 of 3 · What is root mean squared error (RMSE)?
SquareerrorsMeanof squaresRootof that
RMSE

Square the errors, average the squares, take the square root. Large errors count more, so it suits cases where a big miss is especially harmful.

Card 3 of 3 · When do MAE and RMSE differ most?
Equal errorssameOne big missRMSE higherChooseby cost
MAE vs RMSE

When one error is far larger than the rest. Errors 2, 2, 2, 2, 12 give MAE 4 but RMSE about 5.7.

Review with flashcards

Test yourself on this module with workplace flashcards and detailed answers.

Open the module flashcards