Databricks Machine Learning Associate Question 175
Select 2In which of the following scenarios is replacing missing values with the mode most appropriate in a machine learning pipeline?
- A
When a categorical feature has a high frequency for a specific category and the missing values are assumed to align with this category.
- B
When a numerical feature has a skewed distribution and the mode represents the central tendency well.
- C
When a categorical feature has a uniform distribution across its categories.
- D
When a feature is ordinal and the mode is representative of the most frequent rank or level.
- E
When a numerical feature has a normal distribution and the mean or median would be inappropriate to use.
Show answer and explanation
Correct answers: A, D
Explanation
Replacing missing values with the mode is most suitable for categorical features where one category dominates or for ordinal features where the most frequent rank or level is representative of the missing values. It is less appropriate for numerical data, where metrics like the mean or median are usually better choices for handling missing values.
- A. Correct.
Replacing missing values with the mode is appropriate for categorical features where one category dominates in frequency, as it aligns with the assumption that missing values are likely part of the majority class.
- B. Incorrect.
For numerical features, the mode is not typically used to handle missing values, even in skewed distributions, as the mean or median generally captures central tendency more effectively.
- C. Incorrect.
When a categorical feature has a uniform distribution, replacing missing values with the mode is not suitable because no single category dominates, making the mode unrepresentative.
- D. Correct.
For ordinal features, the mode can be appropriate if the most frequent rank or level is representative of the missing values, as it preserves the ordinal nature of the data.
- E. Incorrect.
For numerical features with a normal distribution, the mean or median is generally more appropriate than the mode for handling missing values, as these measures better represent the central tendency in such distributions.