Databricks Machine Learning Associate Question 182
Select 3You are working with a dataset that contains a numerical feature with missing values. You are deciding whether to impute the missing values using the mean or the median. Which of the following considerations should guide your decision?
- A
Imputing with the mean is more sensitive to outliers compared to imputing with the median.
- B
Imputing with the median can better preserve the distribution of skewed data.
- C
Imputing with the mean is computationally faster than imputing with the median for large datasets.
- D
Imputing with the median is always preferred over the mean regardless of the data distribution.
- E
Imputing with the mean works better for data that is normally distributed.
Show answer and explanation
Correct answers: A, B, E
Explanation
The choice between imputing with the mean or the median depends on factors such as the presence of outliers and the distribution of the data. The mean is sensitive to outliers but works well for normally distributed data, while the median is more robust to outliers and better preserves the distribution of skewed data. Understanding the dataset's characteristics is critical to making the right decision.
- A. Correct.
Correct: Mean is sensitive to outliers because extreme values can disproportionately affect the average, making this a valid consideration for deciding between mean and median.
- B. Correct.
Correct: Median is robust to outliers and better captures the central tendency of skewed data, preserving the data distribution more effectively.
- C. Incorrect.
Incorrect: While computational performance may vary slightly, it is not a significant factor in deciding between mean and median imputation for most practical datasets.
- D. Incorrect.
Incorrect: Median is not always preferred. The choice between mean and median depends on the data distribution and the presence of outliers.
- E. Correct.
Correct: Mean works well for normally distributed data as the mean and median are approximately equal in such cases, making the mean a suitable imputation method.