MLA-C01 Data Preparation for Machine Learning Practice Question
A company is preparing a large dataset for a SageMaker built-in XGBoost model. The dataset has missing values in both numeric and categorical features, and some categorical features have high cardinality. Which THREE data preparation steps should the company take to optimize model performance? (Choose three.)
⚠ Common exam trap
AWS often tests the misconception that all data cleaning (including imputation) should be done on the full dataset before splitting, but the correct order is to split first to preserve the independence of the test set and avoid data leakage.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Split the data into training, validation, and test sets before any imputation.
Splitting the data into training, validation, and test sets before any imputation prevents data leakage. If imputation statistics (e.g., mean, median) were computed on the full dataset, information from the validation and test sets would influence the training data, leading to overly optimistic performance estimates and poor generalization to new data.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Remove any rows with outlier values.
Why it's wrong here
Outliers may be valid; removal should be justified, not automatic.
- ✓
Split the data into training, validation, and test sets before any imputation.
Why this is correct
Splitting first prevents data leakage from imputation statistics.
- ✓
Impute missing numeric values with median or mean.
Why this is correct
XGBoost can handle missing but imputation can improve performance if done properly.
- ✓
For categorical features, use one-hot encoding for low cardinality and target encoding for high cardinality.
Why this is correct
This balances dimensionality and predictive power.
- ✗
Apply target encoding to all categorical features regardless of cardinality.
Why it's wrong here
Target encoding for low-cardinality may lead to overfitting; one-hot is often better.
Go deeper
Related to this question
About these practice questions
Courseiva writes every MLA-C01 question from scratch — 835 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This MLA-C01 practice question is part of Courseiva's free Amazon Web Services certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the MLA-C01 exam.