MLS-C01 Modeling Practice Question
A data scientist is training a binary classification model using Amazon SageMaker's XGBoost. The dataset is highly imbalanced (99% negative class, 1% positive class). The data scientist wants to maximize the F1-score. Which parameter adjustment is most appropriate?
⚠ Common exam trap
Many exam-takers confuse hyperparameters that control model complexity (max_depth, subsample) or learning rate (eta) with those that directly handle class imbalance, missing that scale_pos_weight is the specific XGBoost parameter designed for this purpose.
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
✓
Set scale_pos_weight to 99
Setting scale_pos_weight to 99 is the most appropriate adjustment because it directly addresses class imbalance by assigning a higher weight to the minority (positive) class during training. In XGBoost, scale_pos_weight controls the balance of positive and negative weights, typically set as sum(negative instances) / sum(positive instances), which here is 99/1 = 99. This forces the model to penalize misclassifications of the positive class more heavily, thereby improving recall and F1-score.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Set max_depth to 10
Why it's wrong here
Increasing max_depth increases model complexity, which may lead to overfitting, not address imbalance.
- ✗
Set eta to 0.01
Why it's wrong here
Eta (learning rate) controls the step size; lowering it can improve generalization but does not directly handle imbalance.
- ✗
Set subsample to 0.5
Why it's wrong here
Subsample controls the fraction of samples used per tree; it helps with overfitting but not class imbalance directly.
- ✓
Set scale_pos_weight to 99
Why this is correct
scale_pos_weight adjusts the balance of positive and negative weights; a value of 99 (ratio of negatives to positives) helps the model focus on the minority class.
Go deeper
Related to this question
About these practice questions
Courseiva writes every MLS-C01 question from scratch — 1,672 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 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.