Databricks Machine Learning Associate Question 519
Select 3You are working with a dataset in Databricks where the 'age' column has missing values. You are trying to decide whether to impute these missing values with the mean, median, or mode. Which of the following statements are true and should guide your decision?
- A
Imputing with the mean is sensitive to outliers and can skew the dataset if extreme values are present.
- B
Imputing with the median is more robust to outliers compared to imputing with the mean.
- C
Imputing with the mode is best suited for numerical features with skewed distributions.
- D
Imputing with the mode is more appropriate for categorical features rather than numerical ones.
- E
Imputing with the mean or median ensures that the overall variance of the column remains unchanged.
Show answer and explanation
Correct answers: A, B, D
Explanation
When deciding between mean, median, or mode for imputing missing values in Databricks, understanding the nature of the data and the impact of outliers is crucial. The mean is affected by outliers, making it less suitable for skewed data, while the median is robust to such cases. The mode is typically used for categorical features rather than numerical ones. These considerations help ensure that the imputation method aligns with the dataset's characteristics and preserves data integrity.
- A. Correct.
Correct: The mean is sensitive to outliers because it is influenced by extreme values, which can lead to a skewed imputation.
- B. Correct.
Correct: The median is robust to outliers as it represents the middle value of the sorted dataset and is not influenced by extreme values.
- C. Incorrect.
Incorrect: The mode is not typically used for numerical features, especially if the distribution is skewed, as it represents the most frequent value rather than central tendency.
- D. Correct.
Correct: The mode is generally used for categorical features, as it represents the most common category, making it a better fit for non-numerical data.
- E. Incorrect.
Incorrect: Imputing with the mean or median can alter the variance of the column, as missing values are replaced with a constant value, reducing variability.