Calculate root mean squared logarithmic error for regression predictions.
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.
RMSLE = sqrt((1/n) * sum((ln(1 + y_hat_i) - ln(1 + y_i))^2))
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.
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.
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.