Coding Hubs School of AI – Best AI & Full Stack Courses in Delhi NCR | 100% Placement
Limited Offer: Get 50% OFF on AI & Full Stack Courses
📞 Call Now: +91 8448811540
Back to Deep Learning Notes
Topic #272

Root Mean Squared Error

Root Mean Squared Error (RMSE) is simply the square root of MSE — a small change that restores interpretable, same-as-target units, which is exactly why RMSE is the number reported to stakeholders far more often than raw MSE.

Formula

\[ \text{RMSE} = \sqrt{\text{MSE}} = \sqrt{\frac{1}{n}\sum_{i=1}^n (y_i-\hat{y}_i)^2} \]

Numerical Example

Continuing from Mean Squared Error, where \(\text{MSE}\approx11.0\):

\[ \text{RMSE} = \sqrt{11.0} \approx 3.32 \]

If \(y\) is measured in lakhs of rupees, RMSE is also in lakhs of rupees — directly interpretable as "the model's predictions are typically off by about 3.32 lakh," in a way "MSE is 11 squared-lakhs" simply isn't.

RMSE as a Metric, Not Usually as a Training Loss

Because \(\sqrt{\cdot}\) is a monotonically increasing function, minimizing RMSE and minimizing MSE find the exact same optimal weights — the ordering of "better" and "worse" predictions never changes under the square root. In practice, MSE is used directly as the training loss (its gradient is simpler and doesn't involve differentiating through a square root, which is smoother numerically, especially near zero error), while RMSE is computed and reported afterward as the human-interpretable evaluation metric.

Code

import numpy as np

y_true = np.array([10, 20, 30])
y_pred = np.array([12, 18, 35])
mse = np.mean((y_true - y_pred) ** 2)
rmse = np.sqrt(mse)
print(rmse)   # approximately 3.317
import torch
import torch.nn as nn

mse_loss = nn.MSELoss()
y_true_t = torch.tensor([10.0, 20.0, 30.0])
y_pred_t = torch.tensor([12.0, 18.0, 35.0])
rmse = torch.sqrt(mse_loss(y_pred_t, y_true_t))
print(rmse)   # tensor(3.3166)

Common Mistakes

  • Assuming training directly on RMSE (rather than MSE) meaningfully changes what the model learns — since the optimum is identical, this distinction is purely about numerical/gradient behavior, not about the final result in principle.
  • Comparing RMSE values across datasets with different target scales — RMSE's units match the target's units, so an RMSE of 3 means something very different for a target ranging 0–10 versus one ranging 0–1,000,000.

Interview Relevance

Q: "Why would you report RMSE to a non-technical stakeholder instead of MSE?" RMSE is in the same units as the original target variable (since it undoes the squaring with a square root), making it directly interpretable — e.g. "predictions are typically off by 3.3 lakh rupees." MSE's units are squared, which don't map to any intuitive real-world quantity.

Practice Question

A regression model predicting house prices (in lakhs) reports an MSE of 64. What is the RMSE, and how would you phrase it as a sentence a non-technical stakeholder could understand?

Related DL Notes

Want to go beyond the notes?

Join Coding Hubs School of AI's Deep Learning course — live mentorship, real projects, and 100% placement support.

Enroll Now — Free Demo Available
💬 Talk to Advisor
1
WhatsApp

Latest from Our Blog

Insights on AI, Data Science, Full Stack & Career

View All Articles →