Several ways: 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. HTH, Andy> 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 > https://www.stat.math.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! > http://www.R-project.org/posting-guide.html > >
David L. Van Brunt, Ph.D.
2004-Apr-23 02:30 UTC
[R] Extracting the MSE and % Variance from RandomForest
AH! That's the piece. I didn't realize it was a sort of running total. That makes sense. On 4/22/04 20:46, "Liaw, Andy" <andy_liaw at merck.com> wrote:> consisting of the first i trees. So the last element is the mse (or rsq) of > the whole forest.-- David L. Van Brunt, Ph.D. Outlier Consulting & Development mailto: <ocd at well-wired.com>
Possibly Parallel Threads
- Can't seem to finish a randomForest.... Just goes and goe s!
- Can't seem to finish a randomForest.... Just goes and goes!
- Repost: Examples of "classwt", "strata", and "sampsize" i n randomForest?
- Random Forests: Question about R^2
- Which column in randomForest importances (for regression) is MSE and which IncNodePurity