AI Glossary / Statistics and probability / Intermediate

Median absolute error

Definition

Median absolute error is a prediction-error measure obtained by taking the median of the absolute differences between actual values and their corresponding predictions. Often abbreviated MedAE, it describes the middle magnitude of error on the evaluated observations. It uses the same units as the target and is less sensitive than mean absolute error to the size of a few extreme misses.

What it means

Each prediction has an error magnitude, regardless of whether it is too high or too low. Median absolute error orders these magnitudes and selects their center. It therefore answers a different question from the average amount of error or the frequency of very large mistakes.
A small MedAE can coexist with serious failures for a substantial minority of cases. This is a feature of what the median summarizes, not a calculation error. The metric is useful when its interpretation matches the reporting purpose and its limitations are visible.

How it works

Match predictions and actual outcomes for the same cases. Compute the absolute value of each difference, producing a nonnegative list. Sort that list and calculate its median using the stated convention.
For an odd sample count, select the middle absolute error. For an even count, the usual unweighted numerical convention averages the two middle absolute errors. With weights, the cumulative-weight definition and tie convention must be specified.
Use an evaluation set that represents the intended use and was not used to select the model being assessed. In forecasting, respect time order and horizon. A metric can be computed perfectly while the evaluation design remains misleading.
Report the target units. Multiplying actuals and predictions by a common factor multiplies MedAE by that factor's absolute value. This differs from a relative or percentage error measure.
If there are several predicted outputs, decide whether to report a separate median for each output or aggregate output scores. An average of separate medians is not generally the median of every error pooled together. Check the implementation and avoid combining unlike units without a defensible normalization.

Three practical examples

  • Delivery prediction: an operations team reports MedAE in minutes to describe a central timing miss, alongside late-delivery rates.
  • Property valuation: analysts compare typical absolute price discrepancies while also investigating expensive properties and large-error tails.
  • Personal projects: someone building a journey-time predictor tracks MedAE to summarize ordinary performance and separately reviews unusually inaccurate trips.

Think of it this way

Think of arranging cards by how far each prediction missed its target, then reading the card in the middle. Making the last card's miss much larger may not move the middle card at all. That stability is useful for describing the middle, but the last card can still represent a costly problem.

Worked example

Five absolute prediction errors are 1, 2, 2, 3, and 42 minutes. They are already ordered. The middle value is two, so MedAE is two minutes. Mean absolute error is (1 + 2 + 2 + 3 + 42)/5 = 10 minutes.
Now increase the largest error from 42 to 402 minutes. MedAE remains two minutes because the middle rank is unchanged. Mean absolute error rises to 410/5 = 82 minutes. The median's stability does not imply that overall operational harm stayed constant.
A second set of absolute errors is 0, 0, 0, 100, and 100. Its median is zero even though two predictions are very poor. Thus a zero MedAE does not require all predictions to be exact.
Finally, consider signed errors -100, 1, and 2. The signed median is one, whose absolute value is one. But the absolute errors are 100, 1, and 2, with median two. Taking the absolute value after computing a signed median is not the same operation.

Illustrative case study

Fictional case: Elm Routes compares travel-time models. One model has an attractive MedAE, but its largest misses coincide with important scheduled arrivals. The team keeps the median as a description of central performance while adding the proportion of errors above a practical threshold.
It also checks different journey types and retains legitimate disruption cases. The final comparison uses a consistent evaluation period and a baseline predictor. This fictional scenario illustrates how a robust summary can be informative without being sufficient; it does not claim measured business benefits.

Common misconceptions and mistakes

Do not confuse median absolute error with mean absolute error, the absolute value of median signed error, or median absolute deviation around the data's own median. These have different definitions and purposes.
Do not interpret resistance to extreme values as proof that a model is safe or fair for all cases. A poorly served subgroup smaller than half the sample can be hidden by a favorable pooled median. A change affecting many central ranks can also change MedAE substantially.
Do not assume that minimizing MedAE is the same as fitting a conditional-median predictor by minimizing mean absolute loss. One takes a median across case losses; the other minimizes their expectation or average. Their optimization targets and behavior need not coincide.

Business use

MedAE can supplement regression dashboards where a central error magnitude is understandable and useful. Pair it with a mean or tail measure, sample size, baseline, and subgroup comparisons. Define thresholds in the same units as the operational decision.
If large misses create disproportionate costs, retain a metric that captures them rather than treating robustness as permission to ignore them. When reporting trends, check whether the evaluated population, missing-outcome rate, or target scale changed; an improved median may reflect those changes rather than a better model.

People also ask

Can MedAE be negative?

No, ordinary absolute errors and their median are nonnegative.

Does MedAE of zero mean every forecast was correct?

No; enough exact predictions can place the middle error at zero while other errors remain large.

Is it a percentage?

No, unless the inputs themselves are defined on an appropriate percentage scale; ordinarily it has the target's units.

Check your understanding

what is MedAE for absolute errors 1, 4, 6, and 100 using the usual convention?

Answer: five.

if the largest of those errors rises to one thousand, does MedAE change?

Answer: no, the two middle errors remain four and six.

does a low pooled MedAE establish good results for every subgroup?

Answer: no, subgroup performance requires separate examination.

Related terms

  • Mean Absolute Error
  • Median
  • Sample weighting
  • Absolute loss
  • Median absolute deviation
  • Regression evaluation
  • Error quantile
  • Tail risk

Learn next

Next, compare MedAE with upper error quantiles and threshold exceedance rates. Then examine why a metric used to summarize predictions need not be the same objective used to train a model.

More in Statistics and probability

  • Measurement error - Measurement error is the difference between a measured value and an appropriate reference value.
  • Measurement model - A measurement model describes how observations, corrections, and other relevant quantities relate to the quantity being measured.
  • Measures of central tendency (center or central location) - Measures of central tendency, also called measures of center or central location, are summaries intended to represent a typical or central value of a...
  • Median test - The median test, commonly called Mood's median test, is a nonparametric procedure for comparing the population medians of two or more independent groups.
  • Mediation (statistics) - Mediation in statistics concerns an intermediate variable through which an exposure or intervention may affect an outcome.
  • Mendelian randomization - Mendelian randomization, or MR, uses genetic variants as instrumental variables to investigate whether an exposure has a causal effect on an outcome.

Sources

Scikit-learn, median_absolute_error API: https://scikit-learn.org/stable/modules/generated/sklearn.metrics.median_absolute_error.html Scikit-learn, model evaluation, median absolute error: https://scikit-learn.org/stable/modules/model_evaluation.html NIST/SEMATECH, Measures of Location: https://www.itl.nist.gov/div898/handbook/eda/section3/eda351.htm

Previous: Median Next: Median filter

  • Home
  • Daily AI Updates
  • Blog
  • AIFBL Academy
  • AI Glossary
  • Products and Tools
  • Store
  • Free CFO AI Prompt Pack
  • About Shihan Sheriff
  • Privacy Policy
  • Terms of Use
  • Refund Policy
  • Cookie Policy
  • Earnings Disclaimer