Databricks Machine Learning Associate Question 520
Select 3You are working on a dataset in Databricks with several numerical features containing missing values. You need to choose between imputing the missing values using the mean, median, or mode. Which of the following considerations should guide your decision?
- A
The mean is sensitive to outliers and may not be suitable for skewed data.
- B
The median is a robust measure and is more appropriate for skewed data or when outliers are present.
- C
The mode is typically used for numerical data that has a high frequency of a specific value.
- D
Imputing with the mean is always the best option for numerical features, regardless of data distribution.
- E
The mode is more appropriate for categorical data rather than numerical data.
Show answer and explanation
Correct answers: A, B, E
Explanation
When imputing missing values, the choice between mean, median, or mode is guided by the data type (numerical or categorical) and the distribution of the data. The mean is suitable for normally distributed numerical data without outliers, while the median is better for skewed distributions or data with outliers. The mode is better suited for categorical data or numerical data with a high frequency of a specific value.
- A. Correct.
The mean is sensitive to outliers because it calculates the average value. If the data has extreme values, they can distort the mean, making it less representative of the central tendency in skewed data.
- B. Correct.
The median is robust to outliers and skewed distributions because it identifies the middle value, making it a better imputation choice in such cases.
- C. Incorrect.
The mode is not typically used for numerical data unless there is a strong reason to prioritize the most frequent value, which is rare for continuous variables.
- D. Incorrect.
This statement is incorrect because the mean is not always the best option. Its suitability depends on the data distribution and the presence of outliers.
- E. Correct.
The mode is more commonly used for categorical data as it represents the most frequent category, making it less relevant for numerical data.