Question 1,136 of 1,672
MLS-C01 Modeling Practice Question
A data scientist is training a gradient boosting model using SageMaker's built-in XGBoost algorithm. The dataset has missing values in several features. Which TWO actions should the data scientist take to handle missing values effectively? (Choose two.)
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
✓
Impute missing values with the median of each feature using a preprocessing step.
(impute with median) is a standard preprocessing technique that can help gradient boosting models handle missing data. Option E (set the 'missing' parameter) leverages XGBoost's built-in capability to treat missing values as a separate direction, allowing the algorithm to learn the best split. Option D (PCA) is incorrect because PCA does not handle missing values; it requires complete data or imputation first. Option B (one-hot encoding for missingness) is more appropriate for categorical features and may add noise. Option C (remove rows) leads to data loss and is generally not recommended when missing values are not too extensive.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
Impute missing values with the median of each feature using a preprocessing step.
Why this is correct
Median imputation is a robust method that preserves data.
- ✗
Use one-hot encoding to create binary columns indicating missingness.
Why it's wrong here
This increases dimensionality and is not effective for tree-based models.
- ✗
Remove all rows with missing values from the training dataset.
Why it's wrong here
Removing rows reduces data size and may introduce bias.
- ✗
Apply PCA to reduce dimensionality and ignore missing values.
Why it's wrong here
PCA requires complete data and does not handle missing values.
- ✓
Set the 'missing' parameter in XGBoost to a specific value (e.g., 0) and let the algorithm learn the best imputation.
Why this is correct
XGBoost can handle missing values natively by learning the best direction for splits.
About these practice questions
Courseiva creates original exam-style practice questions with explanations and wrong-answer analysis. It does not publish real exam questions, exam dumps, or protected exam content. Learn why practice questions differ from exam dumps →
Last reviewed: Jun 20, 2026
This MLS-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 MLS-C01 exam.
Question Discussion
Share a tip, memory trick, or ask about the reasoning behind this question. Do not post real exam questions, leaked content, braindumps, or copyrighted exam material. Comments are moderated and may be removed without notice.
Sign in to join the discussion.