Why apply a log or other transformation to a heavily skewed variable during EDA, and what does it reveal?

Quick Overview

Asks why a data scientist would log-transform or otherwise transform a heavily skewed variable during exploratory analysis and what the new view can show. Tests understanding of skewed distributions, choosing a transform, and interpreting results on a transformed scale.

Why apply a log or other transformation to a heavily skewed variable during EDA, and what does it reveal?

Role: Data Scientist

Category: Data Manipulation (SQL/Python)

Difficulty: medium

Interview Round: Other

When you notice a heavily skewed variable during EDA, why might you apply a log or other transformation, and what does it reveal? ```hint Start with the raw view Picture a histogram and a scatter plot of something like household income, and ask what the mean, the standard deviation and the axis range describe. ``` ```hint Think in ratios Consider what a log does to the distance between 10 and 100 compared with the distance between 1,000 and 10,000. ``` ### What a Strong Answer Covers - How a long tail distorts summary statistics and plots - What a log transform does to large versus small values, and to multiplicative relationships - How to choose a transform, including data with zeros or negative values - What kinds of structure the transformed view can reveal - How to interpret and report results that are on the transformed scale ### Follow-up Questions - If you fit a regression on $\log(y)$, how do you interpret a coefficient, and what goes wrong if you exponentiate the predictions to estimate the mean of $y$? - A variable has many zeros and a long right tail. What options do you have besides `log(x + 1)`? - Does a tree-based model need a skewed feature to be transformed? Why or why not?

Overview: Asks why a data scientist would log-transform or otherwise transform a heavily skewed variable during exploratory analysis and what the new view can show. Tests understanding of skewed distributions, choosing a transform, and interpreting results on a transformed scale.

General logo
General
Nov 25, 2026
mediumData ScientistOtherData Manipulation (SQL/Python)
0
0

When you notice a heavily skewed variable during EDA, why might you apply a log or other transformation, and what does it reveal?

What a Strong Answer Covers Guidance

  • How a long tail distorts summary statistics and plots
  • What a log transform does to large versus small values, and to multiplicative relationships
  • How to choose a transform, including data with zeros or negative values
  • What kinds of structure the transformed view can reveal
  • How to interpret and report results that are on the transformed scale

Follow-up Questions Guidance

  • If you fit a regression on log⁡(y)\log(y) , how do you interpret a coefficient, and what goes wrong if you exponentiate the predictions to estimate the mean of yy ?
  • A variable has many zeros and a long right tail. What options do you have besides log(x + 1) ?
  • Does a tree-based model need a skewed feature to be transformed? Why or why not?