Courseiva
mediumMultiple Select

AIF-C01 Practice Question: A data scientist has trained a random forest…

A data scientist has trained a random forest model that achieves 92% accuracy on the training set but only 75% on the test set. The dataset has 1000 samples and 20 features. Which THREE actions could help improve the model's generalization? (Select THREE.)

⚠ Common exam trap

A common mistake is assuming that increasing model complexity always improves accuracy, but overfitting requires regularization such as reducing tree depth or increasing minimum split samples.

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

✓

Increase the number of trees in the forest

The scenario describes overfitting: a large gap between training accuracy (92%) and test accuracy (75%). Option A (increase the number of trees in the forest) is correct because adding trees to a random forest averages more decorrelated trees, reducing variance without increasing overfitting, which typically improves test-set generalization. Option C (reduce the maximum depth of each tree) is correct because shallower trees have lower variance and cannot memorize training noise as easily, directly countering the overfitting. Option E (increase the minimum number of samples required to split an internal node) is correct because requiring more samples per split (e.g., raising min_samples_split) forces splits to be based on more evidence, producing simpler, more generalizable trees. Option B (increase the maximum depth) is wrong because deeper trees increase variance and worsen overfitting. Option D (decrease the number of trees) is wrong because fewer trees reduce the averaging benefit and can increase variance, hurting generalization.

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 number of trees in the forest

    Why this is correct

    Adding more trees reduces variance in the ensemble's averaged predictions, which typically improves generalisation on unseen data. This addresses the 92% versus 75% train-test gap, satisfying the scenario's requirement for an action that improves the random forest model's generalisation.

  • ✗

    Increase the maximum depth of each tree

    Why it's wrong here

    Increasing maximum depth lets each tree fit the training data more tightly, enlarging the train-test gap rather than closing it. Depth limits are tuned upward when a model underfits and both training and test accuracy are low, which is not the pattern described here.

  • ✓

    Reduce the maximum depth of each tree

    Why this is correct

    Reducing maximum tree depth constrains each tree's complexity, limiting its ability to memorise training noise. This lowers variance and narrows the 92% versus 75% train-test gap, satisfying the scenario's requirement for an action that improves the random forest model's generalisation.

  • ✗

    Decrease the number of trees in the forest

    Why it's wrong here

    Reducing the number of trees lowers variance averaging across the ensemble, so predictions become noisier and test accuracy typically drops. Tree count is reduced to cut training time or memory when accuracy is already acceptable, not to remedy overfitting on a small dataset.

  • ✓

    Increase the minimum number of samples required to split an internal node

    Why this is correct

    Raising the minimum samples per split forces nodes to retain more data before partitioning, producing simpler trees that generalise better. This reduces the 92% versus 75% train-test gap, satisfying the scenario's requirement for an action that improves the random forest model's generalisation.

About these practice questions

One of 862 original AIF-C01 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This AIF-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 AIF-C01 exam.