MLS-C01 Modeling Practice Question
A machine learning engineer is building a binary classification model to predict customer churn. The dataset is highly imbalanced (5% churn). The engineer wants to use Amazon SageMaker's built-in XGBoost algorithm. Which combination of hyperparameters is most appropriate for this scenario?
⚠ Common exam trap
A common mix-up: candidates confuse `scale_pos_weight` with a simple class weight or mistakenly think a value less than 1 is needed for the minority class, when in fact it should be the ratio of majority to minority class counts.
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
✓
scale_pos_weight=19, subsample=0.8
In a highly imbalanced dataset with only 5% churn, the ratio of negative to positive classes is 95:5, or 19:1. The `scale_pos_weight` hyperparameter in XGBoost should be set to this ratio (19) to penalize misclassifications of the minority class more heavily. A `subsample` of 0.8 introduces stochasticity and helps prevent overfitting, which is especially important when the minority class is small.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
scale_pos_weight=19, subsample=0.8
Why this is correct
Correct ratio and subsample for regularization.
- ✗
scale_pos_weight=0.05, subsample=0.8
Why it's wrong here
scale_pos_weight should be >1 for minority class, not <1.
- ✗
scale_pos_weight=19, subsample=1.0
Why it's wrong here
subsample=1.0 may cause overfitting.
- ✗
scale_pos_weight=1, subsample=1.0
Why it's wrong here
scale_pos_weight=1 does not handle imbalance; subsample=1.0 may overfit.
Go deeper
Related to this question
About these practice questions
This MLS-C01 question is part of Courseiva's 1,672-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam 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 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.