02Home & Garden · Updated
Mean Squared Error: What It Tells You
Short answer
How large prediction errors are on average
Mean squared error (MSE) summarizes the average squared difference between predicted values and actual values. It tells you how far predictions tend to be from the truth, while giving unusually large errors extra influence.
What mean squared error measures
For a set of predictions, mean squared error is the average of the squared residuals: each actual value minus its predicted value, squared, then averaged. In symbols, MSE = (1/n) Σ(yᵢ − ŷᵢ)², where yᵢ is an observed value, ŷᵢ is its prediction, and n is the number of observations.
The result gives one score for the size of prediction errors across the data being evaluated. A lower MSE means predictions are closer to the observed values on average under this squared-error measure. An MSE of zero means every prediction matched its observed value exactly in that particular dataset. By itself, however, the score does not reveal which predictions were wrong, why they were wrong, or whether the model will perform similarly on new data.
For example, suppose a model predicts three delivery times with errors of 1, 2, and 3 minutes. Their squared errors are 1, 4, and 9, so the MSE is 14/3, or about 4.67 square minutes. The score describes the errors collectively, not a typical error of 4.67 minutes.
Why the errors are squared
Squaring has two important effects. First, negative and positive errors cannot cancel each other out: an overprediction of 5 and an underprediction of 5 both contribute 25. Second, larger mistakes count disproportionately more. An error of 4 contributes 16, four times as much as an error of 2, which contributes 4.
This makes MSE useful when large misses are especially undesirable, and it gives the measure convenient mathematical properties for many modeling methods. But it also makes the score sensitive to outliers. One very large residual can dominate the average, even when most predictions are close.
That sensitivity is not automatically a flaw. It may be appropriate if large errors carry much greater consequences. If a few unusual observations are measurement mistakes, or if the goal is to describe ordinary error rather than penalize extremes, investigate those cases and consider another metric as well. Do not remove observations simply because they make a score look worse.
How to interpret the number and its units
MSE is expressed in the square of the target variable’s units. If the target is measured in dollars, the MSE is in squared dollars; if it is measured in meters, the MSE is in square meters. This is mathematically consistent but can be awkward to explain in everyday terms.
A common companion is root mean squared error (RMSE), the square root of MSE. RMSE is expressed in the target’s original units, so an RMSE of 3 minutes is easier to relate to delivery-time errors than an MSE of 9 square minutes. RMSE still gives large errors extra weight, and it is not exactly the average absolute error.
Neither MSE nor RMSE should be treated as a guaranteed error for every prediction. They are summaries calculated on a particular set of cases. To make a result useful, state the units, the dataset, and whether the score came from training data or a separate evaluation set.
Using MSE to compare models
MSE can help compare models when both are tested against the same observations, with the same target definition and evaluation procedure. If one model has a lower test-set MSE, its squared errors were smaller on average for those cases. That is evidence about that test set, not proof that it will always be better.
- Use the same cases: Different samples can produce different scores, so comparisons need a common evaluation set or a carefully designed validation process.
- Keep the scale consistent: Changing the target units changes MSE by the square of the conversion factor. Scores for differently scaled targets are not directly comparable.
- Separate fitting from evaluation: A model’s training MSE can be deceptively low because the model was fitted to those examples. Evaluate on data not used to fit it to estimate performance on unseen cases.
- Check the error pattern: A single average can hide systematic overprediction, underprediction, or poor performance on a particular range of values.
For instance, converting a target from meters to centimeters multiplies each residual by 100 and the MSE by 10,000. The model’s predictions have not become worse; only the units and numerical score have changed. Normalized metrics or a clear baseline can help when comparing targets on different scales, but their definitions must be stated.
What MSE does not tell you
MSE does not show the direction of errors because squaring removes their signs. It cannot tell whether predictions are generally too high or too low. Calculate signed residuals or inspect a residual plot to look for bias and patterns.
It also does not explain the distribution of errors. Two models can have the same MSE while one makes many moderate errors and the other makes mostly tiny errors plus a few extreme ones. Looking at RMSE, mean absolute error, residual plots, and selected error quantiles can provide useful additional views.
Finally, a low score is meaningful only in context. A model might achieve a low MSE by predicting values close to the overall average, yet still fail to capture changes that matter. Compare it with a simple baseline and consider the purpose of the predictions, the cost of different kinds of mistakes, and the limits of the data.
MSE compared with other error metrics
Mean absolute error (MAE) averages the absolute size of residuals instead of squaring them. It uses the target’s original units and is less dominated by a few large errors than MSE. It still does not indicate whether predictions are too high or too low.
RMSE retains MSE’s emphasis on large errors but returns to the original units. R-squared is different: it compares model performance with a baseline based on the target’s variation and can be negative on evaluation data. It is not a substitute for reading error size in practical units. The best metric depends on the question, so reporting more than one can make a model’s behavior clearer.
Frequently Asked Questions
Is a lower MSE always better?
Lower MSE means smaller squared errors on the dataset used to calculate it. For a fair model comparison, use the same evaluation cases and method, and check whether the score reflects performance on data the model did not train on.
Can mean squared error be negative?
No. Squared residuals are zero or positive, so their average cannot be negative. It is zero only when all predictions match the observed values in the evaluated set.
Why use MSE instead of mean absolute error?
MSE penalizes large mistakes more heavily, which can suit tasks where extreme errors matter. MAE is often easier to interpret in the original units and is less sensitive to outliers; neither metric is best for every purpose.
What does an MSE of 10 mean?
It means the average squared residual is 10 in squared target units. Its practical meaning depends on the target’s scale and units; taking the square root gives an RMSE in the original units.
Does MSE show whether a model is biased?
Not on its own. Squaring removes the sign of each residual, so inspect signed errors or residual plots to identify consistent overprediction, underprediction, or other patterns.
Related
- Why Is the Sky Blue? A Simple Explanation
- How to Store Nectarines at Home for Better Freshness
- How to Unclog an Epson EcoTank Printer Safely
Further reading: NIST/SEMATECH e-Handbook of Statistical Methods. Details can change, so check the official page for anything that matters to you. Spotted a mistake? Tell us. How we write an answer.