Databricks Machine Learning Associate Question 539
Single answerYou are working on a machine learning project using Databricks to predict housing prices. The dataset contains a feature for the total square footage of houses, which spans several orders of magnitude (e.g., 100 to 10,000 square feet). After analyzing the feature distribution, you notice it is heavily right-skewed. When would applying a log scale transformation to this feature be appropriate?
- A
When the feature values are not on the same scale as other features in the dataset.
- B
When the feature values are heavily skewed, and you want to reduce the impact of extreme values.
- C
When the feature values are categorical and need to be encoded numerically.
- D
When the feature values follow a normal distribution and need to be standardized.
Show answer and explanation
Correct answer: B
Explanation
Log scale transformation is ideal when feature values are heavily skewed or span several orders of magnitude. By applying a logarithmic transformation, you can reduce the impact of extreme values, making the data distribution more uniform and suitable for machine learning models. In this scenario, the right-skewed square footage feature would benefit from this transformation.
- A. Incorrect.
This is not necessarily a reason to apply a log scale transformation. Features being on different scales can be addressed through standardization or normalization, but log transformations are specifically aimed at handling skewness or wide-ranging values.
- B. Correct.
Correct. Log scale transformation is particularly useful when feature values are right-skewed or span several orders of magnitude, as it compresses large values and spreads out smaller ones, making the data more suitable for machine learning models.
- C. Incorrect.
This is incorrect. Log scale transformations are not used for categorical data, which typically require encoding techniques like one-hot encoding or ordinal encoding.
- D. Incorrect.
This is incorrect. If the feature values already follow a normal distribution, there is no need to apply a log scale transformation. Standardization would be more appropriate for scaling purposes in this case.