Machine LearningRegression Evaluation

What is Mean Squared Error (MSE)?

Mean Squared Error (MSE) measures the average of the squared differences between a regression model's predictions and the actual target values.

It gives larger prediction errors more influence because every error is squared before averaging.

Formula

MSE = (1 / n) × Σ(yi - ŷi)²

where:

  • yi is the actual value
  • ŷi is the predicted value
  • n is the number of observations

Simple example

Suppose the actual values are:

10, 20, 30

and the predictions are:

12, 18, 25

The errors are:

-2, 2, 5

After squaring:

4, 4, 25

So:

MSE = (4 + 4 + 25) / 3 = 11

Why square the errors?

Squaring has two important effects:

  • positive and negative errors cannot cancel each other out
  • large errors receive a much stronger penalty than small errors

For example:

Error = 2  → Squared error = 4
Error = 10 → Squared error = 100

So a few large mistakes can increase MSE substantially.

When is MSE useful?

MSE is useful when large prediction errors are especially undesirable and should influence the evaluation more strongly.

It is also widely used as an optimization objective when training regression models because the squared-error function is mathematically convenient to optimize.

Is lower MSE better?

Yes.

MSE = 0

means every prediction exactly matches the actual value.

A lower MSE generally means smaller prediction errors, but comparisons are most meaningful when models are evaluated on the same target and dataset.

MSE is not in the original target unit

Because the errors are squared, MSE is expressed in squared units.

For example, if the target is measured in rupees, MSE is measured in squared rupees.

This can make MSE harder to interpret directly than MAE.

Root Mean Squared Error (RMSE), covered next, takes the square root of MSE and returns the metric to the target's original unit.

In short, MSE measures average squared prediction error. It strongly penalizes large mistakes, making it useful when large errors matter, but its squared units make direct interpretation less intuitive.

#what is mean squared error#MSE regression#mean squared error formula#mean squared error example#regression evaluation MSE#machine-learning#regression#mse#regression-metrics#regression-evaluation

Learning Sequence

Machine Learning Curriculum

50% Completed
Up NextMachine Learning

What is Root Mean Squared Error (RMSE)?

Explore Related Questions

Deepen your understanding across related Machine Learning topics.

Machinoai Logo
Machinoai

Your edge in the AI era. Deep dives into machine learning concepts, paper explainers, verified industry jobs, and developer tools.

© 2026 Machinoai. All rights reserved.