Courseiva
Data Analysis →hardMultiple Choice

DA0-002 Data Analysis Practice Question

After training a decision tree, the tree has depth 20 and 100% accuracy on training data but only 60% on test data. Which hyperparameter adjustment is most likely to improve generalization?

⚠ Common exam trap

Test-takers frequently confuse hyperparameters that reduce overfitting with those that increase model complexity, mistakenly choosing options like 'increase maximum depth' or 'decrease minimum samples per split' thinking they will improve accuracy.

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 minimum samples per leaf

The model is overfitting: 100% training accuracy vs. 60% test accuracy with a depth-20 tree. Increasing minimum samples per leaf forces the tree to be simpler by requiring more samples in each leaf, reducing variance and improving generalization. This directly combats the overfitting caused by the overly deep tree.

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 number of estimators

    Why it's wrong here

    Adding estimators builds more trees, which reduces variance in a forest but leaves a single overfit tree's high variance untouched. It is tempting because ensembles combat overfitting, yet boosting or bagging is the right choice only when the base learner itself is not the source of memorisation.

  • ✗

    Decrease minimum samples per split

    Why it's wrong here

    Lowering minimum samples per split lets the tree split on ever-smaller subsets, deepening the memorisation that already yields 100% training accuracy. It is tempting because finer splits can capture detail, but that is correct only when underfitting, not this variance-dominated case.

  • ✓

    Increase minimum samples per leaf

    Why this is correct

    Raising minimum samples per leaf prunes splits that isolate tiny, noisy subsets, directly countering the depth-20 overfitting that produces 100% training but 60% test accuracy. This pre-pruning constraint caps tree complexity, trading some training fit for better generalisation.

  • ✗

    Increase maximum depth

    Why it's wrong here

    Increasing maximum depth permits more splits, worsening the variance that produces 100% training and 60% test accuracy. It is tempting because deeper trees can reduce bias, but that is correct only when the model underfits; here the tree already memorises the training set.

About these practice questions

This DA0-002 question is part of Courseiva's 1,004-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 →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This DA0-002 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 DA0-002 exam.