[R] Extracting the MSE and % Variance from RandomForest
andy_liaw at merck.com
Fri Apr 23 03:46:05 CEST 2004
1. Read ?randomForest, especially the `Value' section.
2. Look at str(myforest.rf).
3. Look at print.randomForest.
If the forest has 100 trees, then the mse and rsq are vectors with 100
elements each, the i-th element being the mse (or rsq) of the forest
consisting of the first i trees. So the last element is the mse (or rsq) of
the whole forest.
> From: David L. Van Brunt, Ph.D.
> I'm almost embarrassed to ask... Almost!
> I've typed "names(myforest.rf)" to see that lots of
> interesting info can be
> called out bit by bit...
> But I can't seem to figure out how to just grab one or two
> the summary stats
> so I can save it out into a table alongside the prediction
> for the new data.
> Specifically, though I see "rsq" for all the trees, and ditto
> for "mse",
> (here's the embarrassing part) how do I just save the mse or
> % Var for the
> whole forest? I really can't find it, not for lack of
> looking. Just clearly
> not in the right place!
> Or do I need to calculate it somehow?
> R-help at stat.math.ethz.ch mailing list
> PLEASE do read the posting guide!
More information about the R-help