How does Random Forest estimate conditional expectation E[Y|X] in classification and regression?

Updated May 17, 2026

Short answer

Random Forest approximates E[Y|X] by averaging outcomes of samples falling into similar leaf regions across many trees.

Deep explanation

Each decision tree partitions the feature space into regions R₁, R₂, ..., Rₖ. Within each region, predictions are constant (regression: mean of targets, classification: class probabilities). Random Forest averages these piecewise estimates across many bootstrapped trees. As the number of trees increases, the estimator converges toward the conditional expectation E[Y|X] under certain regularity conditions, making it a non-parametric regression estimator.

Unlock with a Pro subscription to view this section.

View pricing

Real-world example

No real-world example available yet.

Unlock with a Pro subscription to view this section.

Upgrade to Pro

Common mistakes

No common mistakes listed yet.

Unlock with a Pro subscription to view this section.

Upgrade to Pro

Follow-up questions

No follow-up questions available yet.

Unlock with a Pro subscription to view this section.

Upgrade to Pro

More Random Forest interview questions

View all →