Root Mean Squared Log Error (RMSLE) Calculator
Calculate Root Mean Squared Log Error (RMSLE), useful for regression targets spanning several orders of magnitude.
Inputs
Comma-separated actual (true) non-negative values.
Comma-separated predicted non-negative values, same order and count as actual.
RMSLE
0.112352
Number of Samples
4
Step by step
Sum of squared log errors: Σ(ln(1+ŷ_i) − ln(1+y_i))²
(ln(1+110) − ln(1+100))² + (ln(1+230) − ln(1+250))² + (ln(1+950) − ln(1+1000))² + (ln(1+60) − ln(1+50))²
= 0.050492
RMSLE: √[Σ(...)² / n]
√(0.050492 ÷ 4)
= 0.112352
How it works
Root Mean Squared Log Error (RMSLE) applies RMSE to the log-transformed values: RMSLE = √[(1/n) × Σ(ln(1+ŷ_i) − ln(1+y_i))²]. The +1 offset avoids taking the log of zero. Because it operates on logarithms, RMSLE treats relative differences symmetrically — an error where the prediction is half the actual value is penalized similarly to a prediction that's twice the actual value — making it well-suited for targets that span several orders of magnitude, like sales volume, population counts, or pricing data.
Formula
RMSLE = sqrt((1/n) * sum((ln(1 + y_hat_i) - ln(1 + y_i))^2))
- n
- Number of samples
- y_i
- Actual value for sample i
- \hat{y}_i
- Predicted value for sample i
Frequently Asked Questions
Why use RMSLE instead of RMSE?
RMSLE penalizes relative (percentage-like) errors rather than absolute ones, so it's less dominated by a few very large-magnitude targets — this makes it a better fit when the target variable spans several orders of magnitude, such as sales counts across products of vastly different popularity.
Why add 1 before taking the logarithm?
Adding 1 avoids taking the logarithm of zero (which is undefined/negative infinity) when actual or predicted values can legitimately be zero, a common situation in count data like sales or web traffic.
Does RMSLE penalize under-prediction and over-prediction equally?
Yes, roughly — because it operates in log-space, RMSLE treats a prediction that's proportionally too low similarly to one that's proportionally too high by the same ratio, unlike RMSE, which is symmetric in absolute rather than relative terms.