Log and Power Transforms
Many real features are right skewed, with a long tail of large values such as income or city population. Log and power transforms compress that tail toward a more symmetric shape that many models prefer.
Common transforms
- Log transform replaces a value with its logarithm, sharply compressing large values. Use log of one plus the value to handle zeros.
- Square root offers a milder compression for moderate skew.
- Box Cox searches a power parameter that best normalizes strictly positive data.
- Yeo Johnson extends power transforms to handle zero and negative values.
Why it helps
- It reduces skew, making distributions closer to normal.
- It stabilizes variance across the range, helping linear models and regression assumptions.
- It can linearize multiplicative relationships into additive ones.
Remember that transforming a target changes the units of predictions, so you must invert the transform to report results on the original scale.
Key idea
Log and power transforms compress skewed features toward symmetry and stable variance, with Box Cox and Yeo Johnson choosing the power automatically.