Skip to content
ML Academy

Feature engineering and preprocessing · insight-0121

When you log-transform a skewed target, correct the back-transformed predictions toward the mean

Evidence type
documented fact
Difficulty
medium
Roles
Data scientist, ML engineer
Industries
aviation, retail

Summary: situation, action, reason, boundary

  1. Situation

    You model log(revenue) or log(demand) and exponentiate predictions to report totals.

  2. Action

    Use TransformedTargetRegressor to keep the transform consistent, then apply a bias adjustment or calibrate predictions on validation data when totals matter.

  3. Reason

    The exponential of an expected log is below the expected value for a right-skewed variable, so naive back-transformation is biased low.

  4. Boundary

    Revenue, demand, price and duration targets modelled on a log or Box-Cox scale.

Symptom or risk

Back-transformed predictions estimate the median, not the mean; summed forecasts fall systematically short of actual totals.

Exceptions

If the decision needs a median (typical case) rather than a total, the unadjusted back-transform is the right quantity.

Trade-offs

Bias adjustment improves totals but can worsen per-row absolute error.

Pitfalls

Comparing a log-scale RMSE with an original-scale RMSE from another model.

Lessons and concepts

Claims and their sources