What is bootstrap sampling and why does a Random Forest use it?

Last updated 5 November 2026

Bootstrap sampling draws n observations with replacement from a training set of size n. A Random Forest gives each tree its own bootstrap sample so the trees see different data, which makes them diverse enough that averaging reduces variance.

  • What a bootstrap sample looks like:

    • It has the same size as the original data.

    • Some rows appear several times and others not at all. About 63.2% of rows are unique and about 36.8% are left out.

  • Why the forest uses it:

    1. Diversity: each tree fits a slightly different dataset, so the trees' errors are less correlated.

    2. Variance reduction: averaging decorrelated, high-variance trees stabilizes predictions.

    3. Out-of-bag (OOB) evaluation: the rows a tree never saw act as a built-in validation set. Each row is scored only by the trees that left it out (oob_score=True).

  • Cost: Each tree sees fewer distinct points, which adds a little bias per tree. This is usually outweighed by the variance gain.

  • Controlled in scikit-learn by bootstrap (default True) and max_samples.

  • https://www.aivasu.com/notes/machine-learning/how-random-forest-works
  • https://medium.com/@nehasingh890.ns/everything-you-need-to-know-about-decision-trees-random-forests-the-complete-interview-guide-2280b0ec5668
  • https://medium.com/@coder_cat/nail-your-data-science-interview-day-3-decision-trees-random-forests-6aaf9c4352da
All Random Forests interview questions