MLA-C01 Question 89
Select 4You are building a machine learning model to predict customer churn and have collected a dataset with numerical, categorical, and text features. You need to preprocess the data before training the model using Amazon SageMaker. Which of the following actions would be most appropriate to ensure the data is correctly prepared for training?
- A
Normalize numerical features to bring them within a similar range.
- B
Convert categorical variables into one-hot encoded vectors.
- C
Remove all text features from the dataset as they cannot be used for machine learning models.
- D
Use SageMaker's built-in Scikit-learn container for preprocessing steps such as scaling and encoding.
- E
Apply Amazon SageMaker Feature Store to manage feature transformations and ensure consistent preprocessing for training and inference.
Show answer and explanation
Correct answers: A, B, D, E
Explanation
To prepare data for machine learning in SageMaker, it is essential to preprocess numerical, categorical, and text features appropriately. Numerical features should be normalized, categorical features should be one-hot encoded, and text features can be tokenized or embedded rather than removed. SageMaker provides tools such as the Scikit-learn container and Feature Store to streamline preprocessing tasks and maintain consistency across the ML lifecycle.
- A. Correct.
Correct. Normalizing numerical features ensures that features with different scales do not disproportionately influence the model.
- B. Correct.
Correct. Categorical variables need to be converted into numerical representations such as one-hot encoding to be input into most ML models.
- C. Incorrect.
Incorrect. Text features can be used in machine learning by applying techniques such as embedding or tokenization, and removing them outright may lead to loss of valuable information.
- D. Correct.
Correct. SageMaker's Scikit-learn container provides preprocessing utilities, making it easier to scale and encode features before training.
- E. Correct.
Correct. SageMaker Feature Store can manage feature transformations and ensure consistent preprocessing for both training and inference.