Skip to content
Prev 177652 / 398503 Next

Random Forests: Question about R^2

I would like to summarize. Would you please confirm that my summary is
correct? Thank you very much!

Determining R^2 in Random Forests (for a Regression Forest):

1. For each individual case, record a mean prediction on the dependent
variable y across all trees for which the case is OOB (Out-of-Bag);
2. For each individual case, calculate a residual: residual = observed
y - mean predicted y (from step 1)
3. Calculate mean square residual MSE: MSE = sum of all individual
residuals (from step 2) / n
4. Because MSE/var(y) represents the proportion of y variance that is
due to error, then R^2 = 1 - MSE/var(y).

If it's correct, my last question would be:
I am getting as many R^2 as the number of trees because each time the
residuals are recalculated using all trees built so far, correct?

Thank you very much!
Dimitri
On Mon, Apr 13, 2009 at 6:22 PM, Liaw, Andy <andy_liaw at merck.com> wrote: