Mean squared error

Also: MSE, L2 loss, squared error

MSE = (1/n)·Σ(yᵢ − ŷᵢ)². Squaring makes all errors positive and penalizes large errors much more than small ones, which makes MSE smooth to optimize but sensitive to outliers. Its square root (RMSE) is in the target’s units.

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

Example

Predictions (3, 5) against targets (2, 7) have errors 1 and −2, so MSE = (1² + 2²) / 2 = 2.5 and RMSE ≈ 1.58.

See it in the lesson: Linear Regression →

Related terms

More in Evaluation & Validation