Question 118 of 1,672
MLS-C01 Modeling Practice Question
A data scientist is training a binary classification model using Amazon SageMaker's built-in XGBoost algorithm. The dataset is highly imbalanced (95% negative class, 5% positive class). The model achieves high accuracy but poor recall on the positive class. Which TWO actions should the data scientist take to improve recall without significantly sacrificing precision?
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 the ratio of negative to positive samples.
Options B and E are correct. Using scale_pos_weight adjusts the weight of the positive class, directly addressing imbalance. SMOTE oversamples the minority class to balance the dataset. Option A is wrong because subsampling the majority class may lose information. Option C is wrong because increasing max_depth may overfit. Option D is wrong because reducing eta may slow convergence but not directly help imbalance.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Perform random undersampling of the majority class.
Why it's wrong here
Undersampling can discard useful data and reduce precision.
- ✓
Set scale_pos_weight to the ratio of negative to positive samples.
Why this is correct
This parameter assigns higher weight to the minority class, penalizing misclassifications more.
- ✗
Increase the max_depth hyperparameter.
Why it's wrong here
Increasing depth can lead to overfitting, which may harm generalization on minority class.
- ✗
Reduce the learning rate (eta) and increase num_round.
Why it's wrong here
This may improve convergence but does not specifically address class imbalance.
- ✓
Use SMOTE to generate synthetic samples of the minority class.
Why this is correct
SMOTE creates synthetic examples of the minority class, balancing the training set and improving recall.
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 →
Same concept, more angles
1 more way this is tested on MLS-C01
These questions test the same concept from different angles. Work through them to make sure you can recognise it however the exam phrases it.
Variation 1. 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?
easy- A.Set max_depth to 10
- B.Set eta to 0.01
- C.Set subsample to 0.5
- ✓ D.Set scale_pos_weight to 99
Why D: 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.
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.