Courseiva
AI Concepts and FoundationseasyMultiple ChoiceObjective-mapped

AI0-001 AI Concepts and Foundations Practice Question

Exhibit

Refer to the exhibit.

def train_model(X_train, y_train):
    model = RandomForestClassifier(n_estimators=100, max_depth=5)
    model.fit(X_train, y_train)
    return model

# Training
model = train_model(X_train, y_train)

# Evaluation on test set
accuracy = model.score(X_test, y_test)
print('Accuracy:', accuracy)

Refer to the exhibit. The data scientist notices that the model achieves 98% accuracy on the training set but only 72% on the test set. Which change to the model parameters is most likely to reduce this gap?

⚠ Common exam trap

CompTIA often tests the bias-variance tradeoff by presenting overfitting symptoms and expecting candidates to choose a regularization parameter (like reducing max_depth) rather than increasing model complexity or switching model families entirely.

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 max_depth to 3.

The model is overfitting: 98% training accuracy vs. 72% test accuracy. Reducing max_depth to 3 limits the depth of each decision tree, preventing them from memorizing noise and forcing them to learn more generalizable patterns. This is a standard regularization technique for tree-based ensembles.

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 n_estimators to 500.

    Why it's wrong here

    More trees may still overfit if each tree is deep.

  • Set max_depth to None to allow trees to grow fully.

    Why it's wrong here

    Increasing depth often increases overfitting.

  • Reduce max_depth to 3.

    Why this is correct

    Reducing max_depth restricts the tree depth, reducing overfitting.

  • Switch from RandomForest to a linear model like LogisticRegression.

    Why it's wrong here

    Changing algorithm is not a parameter change and may underfit.

About these practice questions

One of 754 original AI0-001 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 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.