Notes

Mean Squared Error (MSE)

Mean Squared Error (MSE) is a simple way to answer: “On average, how far off are my predictions?” It turns a bunch of individual prediction mistakes into one number you can compare across models.

What it measures
For each data point, you take the error (prediction minus true value), square it, and then average across all points. Formally, for true values y and predictions ŷ:

MSE = (1/n) * Σ (yᵢ − ŷᵢ)²

Squaring does two things: it makes negative and positive errors count the same, and it penalizes big misses much more than small ones.

Intuition (with a concrete example)
Imagine predicting house prices. If you’re off by $10k on one house and $50k on another, the $50k mistake dominates MSE because 50k² is 25 times 10k². That’s useful when large errors are especially painful (e.g., budgeting, inventory, medical dosage).

Why it matters in ML
MSE is one of the most common loss functions for regression. Many models are trained by directly minimizing it (or a close relative):

  • Linear regression (ordinary least squares) finds parameters that minimize MSE on the training data.
  • Neural networks for regression often use MSE as the training objective.
  • In evaluation, MSE helps compare models during validation or cross-validation.

How to interpret it (and common gotchas)
MSE is in “squared units” (e.g., dollars²), which can feel unintuitive. That’s why people often report RMSE (square root of MSE) to get back to the original units. Also, MSE is sensitive to outliers; a few extreme points can inflate it dramatically.

Mean Squared Error (MSE) is the average of the squared differences between predicted and true values: MSE = (1/n)∑(ŷ − y)². Squaring penalizes larger errors more heavily and yields a smooth objective that is easy to optimize, making it central for training and evaluating regression models in ML. Example: comparing two house-price models, the one with lower MSE has smaller typical squared prediction error.

Imagine you’re practicing basketball shots and you want a single number that tells you how far your shots usually land from the hoop. Mean Squared Error (MSE) is like that, but for predictions: it measures how far a model’s guesses are from the real answers.

For each prediction, you take the difference between “predicted” and “actual,” square it (so negative and positive misses don’t cancel out, and big mistakes count extra), then average those squared differences. A smaller MSE means the model is generally closer to the truth; a larger MSE means it’s missing by more.