MLS-C01 Overfitting Practice Question
A data scientist is using Amazon SageMaker to train a random forest model for a binary classification task. The dataset has 50 features and 10,000 samples. The model achieves high training accuracy but poor test accuracy. Which TWO actions should the scientist take to improve generalization?
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
✓
Reduce the max_depth of the trees.
The model is overfitting, as indicated by high training accuracy but poor test accuracy. To improve generalization, reduce model complexity. Reducing max_depth (B) limits the depth of each tree, preventing overly specific splits. Increasing min_samples_leaf (E) requires a minimum number of samples per leaf, which smooths the model and reduces variance. These two actions directly combat overfitting in random forests.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Increase the max_samples parameter.
Why it's wrong here
Increasing max_samples may actually increase the variance of individual trees, potentially worsening overfitting, and is not a standard method to reduce overfitting.
- ✓
Reduce the max_depth of the trees.
Why this is correct
Correct. Reducing max_depth limits tree depth, reducing model complexity and overfitting.
- ✗
Increase the max_features parameter.
Why it's wrong here
Increasing `max_features` allows each decision tree in the forest to consider a larger subset of features, which raises tree correlation and reduces ensemble diversity. In an already overfitting model, this exacerbates memorisation of training noise rather than improving generalisation. It is tempting because tuning this parameter can reduce bias in underfitting scenarios, for instance when the dataset has many informative features and model capacity is insufficient.
- ✗
Increase the number of trees (n_estimators).
Why it's wrong here
Increasing the number of trees (n_estimators) reduces variance and can help generalization, but it is less direct than limiting tree complexity. However, the question expects the two most direct methods: reduce max_depth and increase min_samples_leaf.
- ✓
Increase the min_samples_leaf parameter.
Why this is correct
Correct. Increasing min_samples_leaf forces leaves to have more samples, smoothing the model and reducing overfitting.
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.