๐Ÿ”ฅLimited Offer: Get 50% OFFon AI & Full Stack Courses๐Ÿ”ฅ
Back to Deep Learning Notes
Topic #83

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?

Want to go beyond the notes?

Join CodingNow 2.0's Deep Learning course โ€” live mentorship, real projects, and 100% placement support.

Enroll Now โ€” Free Demo Available

Root Mean Squared Error โ€“ FAQs

Quick answers about learning Root Mean Squared Error in Deep Learning.

This free note from CodingNow 2.0 explains Root Mean Squared Error in Deep Learning โ€” concept, syntax and worked code examples you can copy, run and revise before interviews.
Yes. Every Deep Learning topic on CodingNow 2.0, including Root Mean Squared Error, is 100% free with no signup required.
With focused practice, most students grasp Root Mean Squared Error in 1โ€“3 days from these notes; pairing it with CodingNow 2.0's mentor-led course takes you to job-ready depth faster.
Use the code examples in this note, then ask doubts for free on the CodingNow 2.0 Community (/community) โ€” expert instructors answer within 24 hours.
WhatsApp
Call NowEnroll Now