AI0-001 Machine Learning and Deep Learning Practice Question
An ML engineer is tuning a random forest classifier for a medical diagnosis task and observes that training accuracy is 99% while validation accuracy is 78%. She wants to reduce the gap without discarding the ensemble approach. Which change is most likely to reduce the generalization gap?
⚠ Common exam trap
The trap here is assuming that adding more trees or more depth will always improve a random forest, when the gap points to per-tree overfitting that only complexity limits can fix.
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 maximum tree depth and increase the minimum number of samples required at each leaf.
The large train-validation gap indicates that the individual trees are too complex and memorizing the training set. Constraining tree depth and requiring more samples per leaf regularizes each estimator. Because a random forest averages many decorrelated trees, this regularization typically improves validation accuracy while keeping the ensemble's variance-reduction benefits intact.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Add more trees to the ensemble until the out-of-bag error stops decreasing.
Why it's wrong here
Adding trees reduces variance in the ensemble prediction but does not address individual trees that are too deep and memorizing the training data. Out-of-bag error will plateau quickly, and the train-validation gap caused by overly complex base learners will remain. More trees help stability, not the fundamental overfitting of each estimator.
- ✗
Increase the maximum tree depth so each tree can capture more interactions in the training data.
Why it's wrong here
Increasing tree depth makes each tree fit the training set more closely, which enlarges the gap between training and validation accuracy rather than shrinking it. Deep trees memorize noise and idiosyncrasies of the training sample, producing lower training error and worse validation performance. This is the opposite direction from what the engineer needs for a model that is already overfitting.
- ✓
Reduce the maximum tree depth and increase the minimum number of samples required at each leaf.
Why this is correct
A 99% versus 78% split is classic overfitting: individual trees are fitting noise. Limiting depth and raising the minimum samples per leaf constrains tree complexity, forcing each tree to learn broader, more generalizable splits. Combined with the ensemble averaging of a random forest, this typically narrows the train-validation gap while preserving the benefits of bagging and feature subsampling.
- ✗
Disable bootstrap sampling so every tree is trained on the full dataset instead of a random subset.
Why it's wrong here
Bootstrap sampling is a core source of random forest diversity and acts as a regularizer. Training every tree on the full dataset reduces the variance-reduction effect of bagging and makes trees more correlated, which tends to worsen generalization rather than improve it. This change removes a stabilizing mechanism precisely when the model needs more regularization.
About these practice questions
This AI0-001 question is part of Courseiva's 962-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 and reviewed by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
Last reviewed September 2026 · checked against the official CompTIA exam blueprint
This AI0-001 practice question is part of Courseiva's free CompTIA 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 AI0-001 exam.