RMSE(log) — RMSE in log₁₀ Space¶
Only Samples where both \(y_{\text{true}} > 0\) and \(y_{\text{pred}} > 0\) are included;
\(M\) is that set and \(m = |M|\). In the Skill Score the metric is skipped when 50 % or fewer of the scored
targets are strictly positive — decided per scoring call (each fold, each round) on that
call's y_true, not once on y_train. A skipped metric's weight is dropped and the
remaining weights are renormalised; y_train only matters for the run-start check,
which aborts if no weighted metric survives. See Skill Score.
Implementation: custom — sklearn.metrics.root_mean_squared_error applied to the
log₁₀-transformed values.
Running example:
- Transform true values: \(\log_{10}(y_{\text{true}}) \approx [0.699, 1.301, 1.699, 2.000, 2.301]\)
- Transform predictions: \(\log_{10}(y_{\text{pred}}) \approx [0.778, 1.255, 1.740, 1.954, 2.342]\)
- Residuals in log space: \(\approx [-0.079, 0.046, -0.041, 0.046, -0.041]\)
- Squared: \(\approx [0.00627, 0.00209, 0.00171, 0.00209, 0.00171]\); mean \(\approx 0.002777\)
- Result: \(\text{RMSE}_{\log} = \sqrt{0.002777} \approx 0.0527\)
Which number ends up in the report?¶
Two code paths can produce this key, and they do not apply the same rules.
| Target transform | Source | Positivity mask? | 50 % rule? |
|---|---|---|---|
none (or yeo-johnson) |
log diagnostics | yes | yes |
log10 |
transform-space metrics | no — the transform already guarantees it | no |
ln / log1p |
transform-space metrics, keyed rmse_ln / rmse_log1p |
no | no |
With a log10 target transform the model is already fitted in log space, so the value
is computed there directly: only non-finite rows are dropped, and neither the positivity
mask nor the 50 % rule from above applies.
With ln or log1p the transform-space column is named rmse_ln / rmse_log1p, and
rmse_log10 is not produced by that path at all — even though it can still carry a
weight in training.metric_weights, where the Skill Score computes it separately over
the positive subset. Read the column name, not the metric name.
Interpretation¶
An error in log₁₀ space is a ratio, not a difference: \(0.0527\) means the typical prediction is off by a factor of \(10^{0.0527} \approx 1.13\), i.e. about 13 %. The figure is therefore unit-free and comparable across targets of very different magnitude — unlike plain RMSE, which is in the unit of the Target.
Being a root-mean-square, it weights large relative deviations more heavily than small ones: one prediction off by a factor of 10 moves it far more than ten predictions off by 10 %.
When to use¶
- Targets spanning several orders of magnitude, where an absolute error of 5 means something entirely different at \(y = 10\) than at \(y = 10^5\).
- When large relative misses are disproportionately costly and should dominate the score — the log-space counterpart of choosing RMSE over MAE.
Disadvantages¶
- Undefined for non-positive values, so it silently evaluates on a subset of the Samples; compare \(m\) against \(n\) before reading the number.
- Inherits RMSE's outlier sensitivity: a single order-of-magnitude miss dominates.
- Not in the unit of the Target, so it cannot be reported as "off by X MPa".
Compute cost¶
Low — one masked pass plus a log transform.
See also MedAE(log) for the robust counterpart, R²(log) for the explained-variance view of the same space, and OME for the mean absolute log-ratio.