House prices are strongly right-skewed. Why apply a log transformation to the target?
- Exam domain
- Data Processing20% of the exam
- Difficulty
- Medium
- In this mock
- 10 questions on this domainPractise this domain
Why the exam asks this
Data Processing (20% of the exam)
Objective in the exam guide: Identify scenarios where log scale transformation is appropriate
Log scale transformation is named.
Why B is the answer
It makes the distribution closer to symmetric
A log transform compresses a long right tail. Predictions must be exponentiated back before reporting them or computing metrics in price units.
Remember: Log transform skewed positive targets.
How it works
Log transforms reduce right skew in positive data.
In detail
- Log compresses right skew.
- Exponentiate predictions back.
Every option, checked
Knowing why each wrong option fails is how you rule it out on exam day.
A. It makes negative prices possibleWrongMost tempting
Log needs positive values.
Why it tempts: Log of a positive number can be negative, but prices stay positive after exp.
B. It makes the distribution closer to symmetricRight
Log transform skewed positive targets.
C. It removes the need for evaluation metrics on the test setWrong
Metrics are still needed.
D. It turns prices into categoriesWrong
Log keeps values continuous.
Use case
An illustrative scenario, not a real incident.
Illustrative: a log-price model's predictions are exponentiated before computing RMSE in dollars.
See it in different ways
flowchart LR S0["log price"] --> S1["Train"] --> S2["Predict log price"] --> S3["exp back"] --> S4["Compute RMSE"]
How to read this chart
- Read it in order: log price, then Train, then Predict log price, then exp back, then Compute RMSE.
flowchart TD
Q{"Is the positive feature or target right-skewed?"}
Q -->|"Yes"| A0["Consider log"]
Q -->|"No"| A1["Leave as is"]How to read this chart
- At "Is the positive feature or target right-skewed?": if "Yes", go to "Consider log"; if "No", go to "Leave as is".