Coding Now – Best AI & Full Stack Courses in Delhi NCR | 100% Placement
Limited Offer: Get 50% OFF on AI & Full Stack Courses
📞 Call Now: +91 9667708830
Back to Machine Learning Notes
Topic #1716

RMSE

RMSE (Root Mean Squared Error) is simply the square root of MSE — bringing the metric back into the target's original units while keeping MSE's disproportionate penalty on large errors, making it the most commonly reported regression metric in practice.

Formula

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

Worked Example

Reusing \(MSE=0.48\) from Mean Squared Error:

\[ RMSE = \sqrt{0.48} \approx 0.693 \]
from sklearn.metrics import root_mean_squared_error   # current scikit-learn API
import numpy as np

y_true = [52, 58, 62, 68, 75]
y_pred = [51.8, 57.4, 63.0, 68.6, 74.2]

print(root_mean_squared_error(y_true, y_pred))   # 0.6928

# Equivalently, if using an older scikit-learn version without root_mean_squared_error:
from sklearn.metrics import mean_squared_error
print(np.sqrt(mean_squared_error(y_true, y_pred)))   # same result: 0.6928

Version note: older scikit-learn releases required mean_squared_error(y_true, y_pred, squared=False); that squared parameter was deprecated and removed in favor of the dedicated root_mean_squared_error function — check your installed version's documentation rather than relying on an older tutorial's exact syntax.

RMSE ≈ 0.693 vs MAE = 0.64 — Why They Differ

RMSE (0.693) is slightly larger than MAE (0.64) on this same data — this is not a coincidence. RMSE is always \(\geq\) MAE for any dataset, and the gap between them directly signals how much error variability exists: if every error were exactly the same size, RMSE and MAE would be equal; the more errors vary in size (some tiny, some large), the more RMSE exceeds MAE, since squaring disproportionately weights the larger ones.

Why RMSE Is So Commonly the Default-Reported Metric

  • Same units as the target — directly interpretable ("typically off by about 0.69 marks")
  • Still penalizes large errors more than small ones, like MSE, which is often the desired behavior
  • Widely recognized and expected in most business and technical reporting contexts

Practical Use Cases

  • The standard "headline" regression metric reported to both technical and business audiences
  • Comparing models where large errors should be penalized more, but interpretable units still matter

Common Mistakes

  • Reporting RMSE without mentioning MAE alongside it — the gap between them is itself informative about error consistency, and showing only one hides this.
  • Using outdated scikit-learn syntax (squared=False) without checking the installed version's current API.

Interview Relevance

Q: "If RMSE is noticeably larger than MAE for the same model, what does that tell you?" The errors are inconsistent in size — a few large errors are pulling RMSE up disproportionately (since squaring amplifies them), while many errors are likely small; if RMSE and MAE were close, errors would be more uniform in magnitude across all predictions.

Practice Question

Using the MSE you computed for actual \([100, 200, 300]\) and predictions \([110, 190, 305]\), compute RMSE and compare it to the MAE from the previous note's practice question.

Related ML Notes

Want to go beyond the notes?

Join CodingNow's Machine 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 →