Databricks Machine Learning Associate Question 186
Select 4You are working on a dataset in Databricks that includes multiple numerical columns with missing values. Your goal is to prepare the dataset for machine learning. You decide to impute the missing values using the mean or median. Which of the following statements are correct about this approach?
- A
Imputing missing values with the mean can preserve the overall distribution of the data for symmetrical distributions.
- B
Imputing missing values with the median is more robust to outliers compared to mean imputation.
- C
Imputing missing values with the mean or median is only suitable for categorical variables.
- D
Mean and median imputation are computationally inexpensive compared to advanced imputation techniques such as k-Nearest Neighbors (k-NN).
- E
Imputing missing values with the mean or median can introduce bias into datasets with missing values that are not missing at random.
Show answer and explanation
Correct answers: A, B, D, E
Explanation
Imputing missing values with the mean or median is a common preprocessing step for numerical columns in machine learning pipelines. While mean imputation preserves the overall distribution for symmetrical data, median imputation is more robust to outliers. Both methods are computationally efficient but can introduce bias if the missing data mechanism is not random. These methods are not suitable for categorical variables, as they are designed for numerical data.
- A. Correct.
Correct. Imputing missing values with the mean works well for symmetrical distributions because it preserves the central tendency.
- B. Correct.
Correct. Median imputation is less sensitive to outliers because the median is a robust measure that is unaffected by extreme values.
- C. Incorrect.
Incorrect. Mean and median imputation are not suitable for categorical variables because they are designed for numerical data.
- D. Correct.
Correct. Mean and median imputation are relatively simple calculations and require less computational effort compared to more complex methods like k-NN.
- E. Correct.
Correct. If missing values are not missing at random (e.g., systematically missing), imputing with the mean or median can introduce bias into the dataset.