Databricks Machine Learning Associate Question 538
Select 2You are working on a machine learning project to predict housing prices based on various features. Upon examining the dataset, you notice that the 'price' column has a highly skewed distribution with values spanning several orders of magnitude. Which of the following scenarios would indicate that applying a log scale transformation to the 'price' column is appropriate?
- A
The 'price' values range from 10,000 to 10,000,000, and the distribution is right-skewed.
- B
The 'price' column contains negative values, and the distribution is symmetric.
- C
The 'price' values span multiple orders of magnitude, and the model's performance improves after log transformation.
- D
The 'price' column has a normal distribution, and no skew is observed.
- E
The 'price' column contains categorical values representing different price ranges.
Show answer and explanation
Correct answers: A, C
Explanation
Log scale transformations are useful when the data spans several orders of magnitude or is heavily skewed, as they can normalize the distribution and stabilize variance. This is particularly helpful for features like prices, which often exhibit exponential growth or wide-ranging values. However, log transformations are unsuitable for negative or categorical data and unnecessary for already normal distributions.
- A. Correct.
A log scale transformation is appropriate when the data spans several orders of magnitude and is right-skewed. This can help normalize the distribution and improve model performance.
- B. Incorrect.
Log transformation is not suitable for negative values because the logarithm of a negative number is undefined.
- C. Correct.
If the data spans multiple orders of magnitude and model performance improves after a log transformation, it indicates the transformation is appropriate.
- D. Incorrect.
If the data is already normally distributed with no skew, a log transformation is unnecessary and could distort the data.
- E. Incorrect.
Log transformation is not applicable to categorical data, as it is meant for continuous numerical data.