How does the number of trees affect the reliability of the OOB estimate?

Quick Overview

Explain how the number of trees in a random forest changes the reliability of its out-of-bag error estimate. It tests whether you can reason about how many trees vote on each sample, which samples get no out-of-bag prediction, the direction of the bias, and how to pick the forest size.

How does the number of trees affect the reliability of the OOB estimate?

Role: Machine Learning Engineer

Category: Machine Learning

Difficulty: medium

Interview Round: Other

How does the number of trees in a random forest affect the reliability of its out-of-bag (OOB) error estimate? ```hint Count the votes Work out what fraction of trees leave out a given training sample, and how many trees that is for a forest of size $B$. ``` ```hint Compare ensemble sizes Compare the size of the ensemble that produces each OOB prediction with the size of the forest you will deploy. ``` ### What a Strong Answer Covers - How many trees contribute to each sample's OOB prediction, and how that scales with the number of trees - The chance that a sample gets no OOB prediction at all, and what an implementation does with such samples - The direction of the bias when the forest is small - How to choose the number of trees in practice, and what limits the estimate once the curve flattens ### Follow-up Questions - Why does OOB error not start rising as you keep adding trees, the way validation error can for boosting? - When is OOB error a misleading estimate of generalization error even with many trees? - How does setting `max_samples` below the training set size change the OOB estimate?

Overview: Explain how the number of trees in a random forest changes the reliability of its out-of-bag error estimate. It tests whether you can reason about how many trees vote on each sample, which samples get no out-of-bag prediction, the direction of the bias, and how to pick the forest size.

Nov 24, 2026
mediumMachine Learning EngineerOtherMachine Learning
0
0

How does the number of trees in a random forest affect the reliability of its out-of-bag (OOB) error estimate?

What a Strong Answer Covers Guidance

  • How many trees contribute to each sample's OOB prediction, and how that scales with the number of trees
  • The chance that a sample gets no OOB prediction at all, and what an implementation does with such samples
  • The direction of the bias when the forest is small
  • How to choose the number of trees in practice, and what limits the estimate once the curve flattens

Follow-up Questions Guidance

  • Why does OOB error not start rising as you keep adding trees, the way validation error can for boosting?
  • When is OOB error a misleading estimate of generalization error even with many trees?
  • How does setting max_samples below the training set size change the OOB estimate?