Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

treesize

Size of trees in an ensemble


Description

Size of trees (number of nodes) in and ensemble.

Usage

treesize(x, terminal=TRUE)

Arguments

x

an object of class randomForest, which contains a forest component.

terminal

count terminal nodes only (TRUE) or all nodes (FALSE

Value

A vector containing number of nodes for the trees in the randomForest object.

Note

The randomForest object must contain the forest component; i.e., created with randomForest(..., keep.forest=TRUE).

Author(s)

See Also

Examples

data(iris)
iris.rf <- randomForest(Species ~ ., iris)
hist(treesize(iris.rf))

randomForest

Breiman and Cutler's Random Forests for Classification and Regression

v4.6-14
GPL (>= 2)
Authors
Fortran original by Leo Breiman and Adele Cutler, R port by Andy Liaw and Matthew Wiener.
Initial release
2018-03-22

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.