Data Science & ML
Basic

Root Mean Squared Error (RMSE)

Square root of MSE, in the same units as the target variable.

Formula

RMSE=1n∑i=1n(yi−y^i)2RMSE = \sqrt{\frac{1}{n}\sum_{i=1}^{n}(y_i - \hat{y}_i)^2}

Variables

y_iActual
\hat{y}_iPredicted
nSamples

Example

If MSE = 4.67, RMSE = 2.16

How it works

RMSE measures the typical size of prediction errors by squaring each residual, averaging those squared errors, and then taking the square root. The squaring step makes larger mistakes count more heavily, while the square root brings the result back to the same units as the target variable, so it is easy to interpret. It comes directly from the mean squared error (MSE) and is useful when you want a single number that summarizes both the frequency and severity of prediction errors.

When to use it

Use RMSE when evaluating regression models, such as predicting house prices, temperatures, sales, or demand, especially when larger errors should be penalized more. It is a common metric for comparing models on the same dataset and target scale.

Worked example, step by step

Actual values: 10, 12, 14, 16 Predicted values: 9, 13, 15, 15 Errors: 10-9 = 1, 12-13 = -1, 14-15 = -1, 16-15 = 1 Squared errors: 1^2 = 1, (-1)^2 = 1, (-1)^2 = 1, 1^2 = 1 Mean squared error: (1 + 1 + 1 + 1) / 4 = 1 RMSE = sqrt(1) = 1 Final answer: RMSE = 1 unit

Common mistakes to avoid

  • Forgetting to square the errors before averaging them
  • Using RMSE to compare models on different target scales without standardizing
  • Assuming a lower RMSE is always better without checking whether the scale is acceptable for the problem

Did You Know?

RMSE is preferred when you want the error in the original units.

Share this formula

Reviewed & maintained by the FormulaWon editorial teamLast reviewed September 2026