Regression Model Evaluation Machine Learning 22 min read June 10, 2026
BY: Statistics Fundamentals Team
Reviewed By: Minsa A (Senior Statistics Editor)

RMSE (Root Mean Square Error): Formula, Calculation & Interpretation

After training a regression model, the first question is always: how close are the predictions to reality? RMSE answers that directly. It converts the gap between each predicted and actual value into a single number expressed in the same units as your target variable — dollars, degrees, kilograms — making it one of the most interpretable error metrics in statistics and machine learning.

This guide covers the RMSE formula, a worked numeric example from scratch, a step-by-step calculation walkthrough, how to interpret the result, comparisons with MAE, MSE, and R², code for Python and Excel, and an interactive calculator where you can paste your own data.

What You'll Learn
  • ✓ The RMSE formula and what every symbol means
  • ✓ How to calculate RMSE step by step with a numeric example
  • ✓ How to interpret RMSE — what counts as a good value
  • ✓ RMSE vs MAE, MSE, and R² — when to use each
  • ✓ How to calculate RMSE in Python (scikit-learn) and Excel
  • ✓ An interactive RMSE calculator for your own data
  • ✓ Real-world applications across machine learning, finance, and forecasting

What Is RMSE? (Definition)

Definition — Root Mean Square Error (RMSE)
RMSE is the square root of the average of squared differences between predicted values and actual values. It measures how far off a model's predictions are from the true outcomes, on average, expressed in the same units as the target variable.
RMSE = √[ (1/n) · Σ(yᵢ − ŷᵢ)² ]

The full name — Root Mean Square Error — describes the calculation literally: take each prediction error, square it (the "square" step), average those squared errors (the "mean" step), then undo the squaring with a square root (the "root" step). The result lands back in the original units of your outcome variable, which is why RMSE is so widely reported: a model predicting house prices with RMSE = $12,000 is immediately understandable in a way that MSE = 144,000,000 is not.

RMSE is also called the Root Mean Square Deviation (RMSD), particularly in fields like meteorology and geoscience. The two terms refer to the same calculation. In simple linear regression and multiple linear regression, RMSE is one of the primary metrics for assessing how well the fitted line explains the data.

📌
Featured Snippet Answer

RMSE (Root Mean Square Error) measures prediction accuracy in regression models. It is calculated as the square root of the average squared differences between predicted and actual values: RMSE = √[ (1/n) · Σ(yᵢ − ŷᵢ)² ]. Lower RMSE means more accurate predictions. RMSE is expressed in the same units as the target variable.

Same units
as target variable
Lower = better
model accuracy
√MSE
mathematical relationship
Penalizes
large errors more

RMSE Formula

The RMSE formula has two common forms. The standard form divides by n (treating the dataset as the full population of predictions you care about). Some texts use n − 1 in the denominator for sample correction, though in practice the difference is negligible for any reasonably large dataset.

RMSE Formula — Standard Form
RMSE = √[ (1/n) · Σᵢ₌₁ⁿ (yᵢ − ŷᵢ)² ]
Equivalently: RMSE = √MSE
n = number of observations yᵢ = actual (observed) value for observation i ŷᵢ = predicted value for observation i yᵢ − ŷᵢ = residual (prediction error) Σ = sum over all n observations

Breaking Down the Formula

Each symbol in the formula plays a specific role. Understanding what each piece does helps you interpret the final number correctly.

Symbol Name What it represents
yᵢActual valueThe true, observed outcome for the i-th data point
ŷᵢPredicted valueThe value your model output for the i-th data point
yᵢ − ŷᵢResidualThe signed error for observation i; negative if overpredicted
(yᵢ − ŷᵢ)²Squared residualMakes all errors positive; heavily weights large errors
(1/n) Σ(...)²MSEThe average of squared residuals — Mean Squared Error
√MSERMSEThe square root returns units to the original scale

The squaring step is the defining feature of RMSE. Because squaring is a nonlinear operation, an error of 10 units contributes 100 to the sum, while an error of 1 unit contributes only 1. A single large error can dominate the RMSE. This is both the strength (RMSE catches outlier predictions that other metrics may miss) and the limitation (one bad prediction inflates RMSE disproportionately) of the metric.

Formula source: Hyndman, R.J. & Koehler, A.B. (2006). Another look at measures of forecast accuracy. International Journal of Forecasting, 22(4), 679–688. doi:10.1016/j.ijforecast.2006.03.001

How to Calculate RMSE (Step by Step)

The calculation follows five steps that can be done by hand for small datasets, in a spreadsheet, or with a single function call in Python. The steps below use a concrete numeric example so every operation is visible.

1

List actual and predicted values

Gather your actual observed values (yᵢ) and the corresponding predictions from your model (ŷᵢ). You need one actual-predicted pair for each observation in your evaluation set.

2

Compute the residual for each observation

Subtract the predicted value from the actual value: eᵢ = yᵢ − ŷᵢ. Positive residuals mean the model underpredicted; negative residuals mean it overpredicted. The sign does not matter yet because the next step squares everything.

3

Square each residual

Calculate eᵢ² = (yᵢ − ŷᵢ)² for each observation. Squaring eliminates negative signs and amplifies the contribution of larger errors relative to smaller ones.

4

Average the squared residuals (compute MSE)

Sum all squared residuals and divide by n: MSE = (1/n) · Σeᵢ². This intermediate value is the Mean Squared Error. RMSE and MSE measure the same thing — only the scale differs.

5

Take the square root

RMSE = √MSE. The square root brings the unit back from squared units (e.g., dollars²) to the original unit (dollars). This is the reported RMSE value.

Worked Example — RMSE Calculation

Worked Example — RMSE from Scratch

Problem: A regression model predicts weekly sales (in $1,000s) for 6 stores. The actual and predicted values are shown below. Calculate the RMSE.

Recall: RMSE Formula
RMSE = √[ (1/n) · Σ(yᵢ − ŷᵢ)² ]
Store (i) Actual yᵢ ($k) Predicted ŷᵢ ($k) Residual eᵢ = yᵢ − ŷᵢ Squared eᵢ²
1424024
25558−39
36763416
47175−416
5838039
69098−864
Sum of squared errors (SSE)118
MSE = 118 / 619.67
RMSE = √19.67≈ 4.43
1

Residuals: (42−40)=2, (55−58)=−3, (67−63)=4, (71−75)=−4, (83−80)=3, (90−98)=−8

2

Squared residuals: 4, 9, 16, 16, 9, 64

3

Sum of squared errors: 4 + 9 + 16 + 16 + 9 + 64 = 118

4

MSE: 118 / 6 = 19.667

5

RMSE: √19.667 ≈ 4.43

✅ Interpretation: The model's weekly sales predictions are off by roughly $4,430 on average. Notice that Store 6 (actual = 90, predicted = 98, error = −8) contributed 64 out of 118 total squared error — more than half — illustrating RMSE's sensitivity to large individual errors.

Calculation methodology follows James, G., Witten, D., Hastie, T., & Tibshirani, R. (2021). An Introduction to Statistical Learning (2nd ed.). Springer. Chapter 2. statlearning.com

RMSE Calculator

Enter your actual and predicted values below — one pair per line, separated by a comma. The calculator shows the full breakdown including each residual, MSE, and RMSE.

Interactive RMSE Calculator

Format: one pair per line as actual, predicted. Example: 42, 40

How to Interpret RMSE

RMSE does not have a universal scale. An RMSE of 5 could be excellent (predicting temperatures in Celsius to within 5°) or terrible (predicting house prices that vary by $5,000 but RMSE is $50,000). Interpretation always requires context.

What Is a Good RMSE Value?

Three benchmarks help judge whether a given RMSE is acceptable.

✓ Good — Use this benchmark

RMSE is noticeably lower than the standard deviation (SD) of the target variable. The ratio RMSE/SD < 0.5 is a common practical threshold for a model that adds real predictive value beyond just predicting the mean.

~ Moderate — Depends on use case

RMSE is close to the SD of the target. RMSE/SD between 0.5 and 1.0. The model captures some variance but there is room for improvement. May be acceptable for rough forecasting but not precise prediction.

✗ Poor — Model adds little value

RMSE ≥ SD of the target variable. RMSE/SD > 1.0. The model is no better — or worse — than simply predicting the mean every time. Revisit feature engineering, model selection, or data quality.

⚡ RMSE Interpretation Rules
  • Compare models, not absolute values. RMSE is most useful for comparing two or more models evaluated on the same dataset. The model with lower RMSE fits better.
  • Context of the domain matters. In weather forecasting, a 1°C RMSE in temperature is excellent; in predicting stock returns, it might be poor. Know what error scale is acceptable in your field.
  • Use RMSE/SD as a normalized benchmark. Dividing RMSE by the standard deviation of the target variable gives a unitless ratio that generalizes across different problems.
  • Watch for outliers inflating RMSE. A single extreme prediction error can dominate RMSE. If RMSE and MAE diverge widely, investigate whether outliers are driving the difference.
  • Train vs. test RMSE gap signals overfitting. If training RMSE is much lower than test RMSE, the model has overfit the training data and will not generalize well to new observations.

RMSE Relative to Standard Deviation — Example

Suppose you are predicting apartment rental prices. The mean monthly rent in your dataset is $1,850 and the standard deviation is $420. You train two models and evaluate them on a held-out test set.

Model RMSE ($) RMSE / SD Verdict
Baseline (predict mean always)4201.00No predictive value
Linear Regression3100.74Moderate — captures some variance
Gradient Boosting1850.44Good — substantially better than baseline

The gradient boosting model's RMSE ($185) is less than half the target's standard deviation ($420), placing it in the "good" range. The linear regression model improves over the baseline but leaves considerable unexplained variance.

Benchmarking approach from Willmott, C.J. & Matsuura, K. (2005). Advantages of the mean absolute error (MAE) over the root mean square error (RMSE) in assessing average model performance. Climate Research, 30, 79–82. doi:10.3354/cr030079

RMSE vs MSE vs MAE vs R²

No single metric tells the full story. Using multiple evaluation metrics gives a more complete picture of model performance. The table below covers the four most common regression metrics.

Property RMSE MSE MAE
Formula√[ Σ(y−ŷ)² / n ]Σ(y−ŷ)² / nΣ|y−ŷ| / n1 − SSR/SST
UnitsSame as ySquared units of ySame as yUnitless (0–1)
Range[0, ∞)[0, ∞)[0, ∞)(−∞, 1]
Penalizes large errors?Yes — heavilyYes — heavilyNo — equallyYes (via SSR)
Sensitive to outliers?YesYesLess soYes
Interpretable scale?YesNo (squared)YesYes (% variance)
Best forGeneral-purpose error reporting when large errors matterGradient optimization in ML training loopsRobust error reporting when outliers existExplaining variance explained by the model

RMSE vs MAE — Which Should You Use?

This is the most common choice practitioners face. Both are in the same units as the target variable and both equal zero for a perfect model. The difference is how they treat large errors.

⚖️
Decision Rule — RMSE vs MAE

Use RMSE when large prediction errors are disproportionately costly (e.g., a forecast that is off by $10,000 is much more than 10× as bad as one off by $1,000). Use MAE when all errors should be weighted equally, or when the dataset contains outliers that should not dominate the metric.

When RMSE and MAE give similar numbers, the model's errors are consistent in magnitude — there are no extreme outlier predictions. When RMSE is noticeably higher than MAE (roughly RMSE/MAE > 1.5), it signals the presence of a few large errors pulling RMSE up. Investigating those specific predictions often reveals data quality issues or edge cases the model handles poorly.

RMSE vs MSE

RMSE is simply the square root of MSE. They are mathematically equivalent for comparing models: if Model A has lower MSE than Model B, it will also have lower RMSE. The only practical reason to prefer RMSE over MSE is interpretability — RMSE is in the same units as the target, making it easier to communicate. During model training, MSE is often preferred as the loss function because its gradient is smoother than that of RMSE (no division by RMSE in the gradient calculation).

RMSE vs R²

R² (the coefficient of determination) measures the proportion of variance in the target variable explained by the model, on a 0–1 scale (values below 0 indicate the model is worse than predicting the mean). RMSE and R² are related but measure different things. A high R² does not guarantee a low RMSE in absolute terms — it depends on the scale of the target variable. For comparing models across different datasets, R² is more meaningful. For communicating prediction accuracy in the real-world units of the problem, RMSE is more meaningful. In regression analysis, reporting both is standard practice. Learn more about regression metrics at Statistics Fundamentals.

How to Calculate RMSE in Python and Excel

RMSE in Python (scikit-learn)

scikit-learn's mean_squared_error function accepts an optional squared=False parameter that returns RMSE directly, or you can take the square root of MSE manually.

Python — scikit-learn
from sklearn.metrics import mean_squared_error
import numpy as np

y_actual   = [42, 55, 67, 71, 83, 90]
y_predicted = [40, 58, 63, 75, 80, 98]

# Method 1: squared=False (scikit-learn ≥ 0.24)
rmse = mean_squared_error(y_actual, y_predicted, squared=False)

# Method 2: manual square root
mse  = mean_squared_error(y_actual, y_predicted)
rmse = np.sqrt(mse)

print(f"RMSE: {rmse:.4f}")  # Output: RMSE: 4.4347
🐍
Note on scikit-learn version

In scikit-learn ≥ 1.4, the squared parameter was deprecated in favour of a dedicated root_mean_squared_error function. Both approaches above work across all common versions.

How to Calculate RMSE in Excel

There is no built-in RMSE function in Excel, but the calculation takes a single formula. Place actual values in column A (A2:A7) and predicted values in column B (B2:B7), then enter this in any empty cell:

Excel Formula
=SQRT(SUMXMY2(A2:A7, B2:B7) / COUNT(A2:A7))
SUMXMY2(array1, array2) = Σ(xᵢ − yᵢ)² — Excel's built-in sum of squared differences

Real-World Applications of RMSE

RMSE appears across industries wherever quantitative predictions are made and accuracy must be measured objectively.

🏠

Real Estate Pricing

Automated valuation models report RMSE in dollars to quantify how far off typical price estimates are from actual sale prices.

🌤️

Weather Forecasting

Numerical weather prediction models are evaluated with RMSD for temperature, wind speed, and precipitation forecasts against observed values.

📈

Sales Forecasting

Demand planning teams use RMSE to compare forecast models for inventory optimization, where large errors cause stockouts or excess inventory.

🤖

Machine Learning (Kaggle)

Many regression competitions on Kaggle use RMSE or its log-transformed variant (RMSLE) as the official competition metric.

💊

Pharmacokinetics

Drug concentration models are assessed with RMSE to validate that predicted plasma concentration curves match observed patient data.

🎬

Recommendation Systems

The Netflix Prize used RMSE to evaluate collaborative filtering models predicting user ratings. Reducing RMSE by 10% was the contest benchmark.

Netflix Prize overview: Bennett, J. & Lanning, S. (2007). The Netflix Prize. Proceedings of KDD Cup and Workshop. proceedings PDF

Normalized RMSE (NRMSE)

Because RMSE is in the units of the target variable, it cannot be directly compared across datasets with different scales. Normalized RMSE (NRMSE) divides RMSE by a range or dispersion measure to produce a dimensionless score.

Normalization Method Formula When to use
Range normalizationRMSE / (y_max − y_min)Quick comparison; sensitive to outliers in range
SD normalizationRMSE / SD(y)Most recommended; robust and interpretable
Mean normalization (CV(RMSE))RMSE / mean(y) × 100%Common in engineering and climate science
IQR normalizationRMSE / IQR(y)When data has heavy tails or outliers

SD normalization is the most statistically grounded approach. An NRMSE of 0.40 (RMSE = 40% of SD) means the model's average error is 40% of the natural spread in the target variable — a number that transfers across different regression problems. Learn more about standard deviation and variance on Statistics Fundamentals.

Frequently Asked Questions

RMSE stands for Root Mean Square Error. Each word describes a step in the calculation: you take each prediction error (Error), square it (Square), average the squared errors (Mean), then take the square root of that average (Root). The result is in the same units as the target variable you are predicting.

Yes. RMSE = 0 means the model predicts every observation exactly. Any positive RMSE represents average prediction error. When comparing two models on the same dataset, the model with lower RMSE is more accurate. There is no good RMSE value in isolation — the number only becomes meaningful when benchmarked against the scale of the target variable or compared to competing models.

Both measure average prediction error in the same units as the target variable. The key difference is how errors are aggregated. MAE averages the absolute errors equally: MAE = (1/n) Σ|yᵢ − ŷᵢ|. RMSE squares the errors first, which means large errors contribute disproportionately. If your RMSE is much larger than your MAE, it indicates the model has a few large errors. If they are close, errors are consistent in magnitude. Use RMSE when large errors are especially harmful; use MAE for a robust, outlier-resistant measure.

There is no universal threshold because RMSE is in the units of the target variable. The most useful benchmark is the ratio RMSE / SD(y). A ratio below 0.5 generally indicates a model that adds meaningful predictive value. For Kaggle competitions, the leaderboard defines what "good" means in context — a top 10% solution on a housing price competition might have RMSE around $12,000–$18,000 depending on the price range of the dataset. Always compare RMSE across models on the same evaluation set using consistent train/test splits.

Yes, but only if the model predicts every single observation exactly (all residuals are zero). In practice this only occurs when a model is evaluated on its exact training data with no regularization — a severe case of overfitting. On a proper held-out test set, RMSE will always be greater than zero due to noise in real data.

In regression analysis, RMSE measures the average deviation of the fitted line (or surface) from the actual data points. For example, in simple linear regression predicting salary from years of experience, an RMSE of $4,500 means the regression line is, on average, $4,500 away from each actual salary in the evaluation set. A lower RMSE means the line fits the data more closely. In multiple linear regression, RMSE is used the same way but the model has more predictors.

The formula is identical: RMSE = √[ (1/n) · Σ(yᵢ − ŷᵢ)² ]. The difference is in how the evaluation set is constructed. In statistics, RMSE is often computed on in-sample residuals from a fitted model. In machine learning, best practice requires evaluating RMSE on a held-out test set (or via cross-validation) that was not used during training. In-sample RMSE can be misleadingly low for complex models that overfit; test-set RMSE gives a more honest measure of real-world accuracy.

RMSE Quick Reference

ItemDetail
Full nameRoot Mean Square Error (also Root Mean Square Deviation, RMSD)
FormulaRMSE = √[ (1/n) · Σ(yᵢ − ŷᵢ)² ]
Equivalent to√MSE
UnitsSame as the dependent variable y
Range[0, ∞) — zero is perfect; higher is worse
Error weightingSquares errors — large errors weighted more heavily
Outlier sensitivityHigh — one large error can dominate RMSE
Best comparison metricMAE (for outlier-robustness) and R² (for variance explained)
Python (sklearn)mean_squared_error(y_true, y_pred, squared=False)
Excel=SQRT(SUMXMY2(actual, predicted) / COUNT(actual))
Good RMSE benchmarkRMSE / SD(y) < 0.5
Common inRegression, ML model evaluation, forecasting, Kaggle competitions