MLA-C01 Question 293
Select 3A company is building a machine learning model to predict customer churn using Amazon SageMaker. During the development process, the team notices that the training dataset contains missing values and categorical features. Which steps should the team take to properly prepare the data for training?
- A
Use Amazon SageMaker Data Wrangler to handle missing values and encode categorical features.
- B
Exclude all rows with missing values to prevent bias in the model.
- C
Apply one-hot encoding to categorical features and impute missing values using the mean or median.
- D
Directly feed the raw dataset into the SageMaker training job without any preprocessing to let SageMaker handle missing values and categorical features.
- E
Use Amazon SageMaker Processing Jobs to preprocess the data before training.
Show answer and explanation
Correct answers: A, C, E
Explanation
Proper data preprocessing is a critical step in machine learning workflows to ensure the model can learn effectively. SageMaker provides tools like Data Wrangler and Processing Jobs to handle missing values and encode categorical features. Additionally, techniques such as one-hot encoding and imputation are widely used for preparing datasets. Excluding data with missing values entirely or directly using raw data without preprocessing can lead to suboptimal or biased model performance.
- A. Correct.
This option is correct. Amazon SageMaker Data Wrangler provides tools to preprocess data, including handling missing values and encoding categorical features.
- B. Incorrect.
This option is incorrect. Excluding all rows with missing values can lead to data loss and potentially biased results, especially if missing data is not random.
- C. Correct.
This option is correct. One-hot encoding is a standard technique for handling categorical data, and imputing missing values with statistical measures like the mean or median is a common preprocessing step.
- D. Incorrect.
This option is incorrect. SageMaker does not automatically handle missing values or encode categorical features unless explicitly specified in your code or preprocessed beforehand.
- E. Correct.
This option is correct. Amazon SageMaker Processing Jobs can be used to preprocess data, including imputing missing values and transforming categorical features, before training a model.