MLA-C01 Question 3
Select 2You are building a machine learning pipeline to predict customer churn using Amazon SageMaker. Your dataset contains missing values in several features, and some features have a high cardinality. Which of the following steps should you take to prepare the data for training? (Select TWO.)
- A
Impute missing values using statistical methods such as mean, median, or mode.
- B
Remove features with missing values to avoid introducing bias into the model.
- C
Use one-hot encoding for categorical features with high cardinality.
- D
Use embedding layers to represent high-cardinality categorical features.
- E
Normalize numerical features to improve model convergence.
Show answer and explanation
Correct answers: A, D
Explanation
Preparing data for machine learning involves addressing missing values and high-cardinality categorical features efficiently. Imputation ensures that missing values do not reduce the dataset's utility, while embedding layers effectively handle high-cardinality features without inflating dimensionality. These steps are crucial for building an effective ML pipeline.
- A. Correct.
Imputing missing values using statistical methods is a common and effective way to handle missing data, ensuring the dataset remains usable for training.
- B. Incorrect.
Removing features with missing values is not always ideal, as it can lead to loss of potentially important information. Imputation is typically preferred.
- C. Incorrect.
One-hot encoding is not efficient for high-cardinality categorical features, as it can significantly increase the dimensionality of the dataset.
- D. Correct.
Using embedding layers is a best practice for handling high-cardinality categorical features, as it reduces dimensionality and captures relationships between categories.
- E. Incorrect.
Although normalizing numerical features can improve convergence in certain algorithms, this is unrelated to handling missing values or high-cardinality categorical features in this scenario.