bigrf (version 0.1-12)

grow-methods: Grow More Trees in a Random Forest

Description

Grow more trees in a random forest, using the same parameters.

Usage

"grow"(forest, x=NULL, ntrees=50L, printerrfreq=10L, printclserr=TRUE, reuse.cache=FALSE, trace=0L)

Arguments

forest
A random forest of class "bigcforest".
x
A big.matrix, matrix or data.frame of predictor variables. The data must not have changed, otherwise unexpected modelling results may occur. If a matrix or data.frame is specified, it will be converted into a big.matrix for computation. Optional if reuse.cache is TRUE.
ntrees
The number of additional trees to grow in the forest. Default: 50.
printerrfreq
An integer, specifying how often error estimates should be printed to the screen. Default: error estimates will be printed every 10 trees.
printclserr
TRUE for error estimates for individual classes to be printed, in addition to the overall error estimates. Default: TRUE.
reuse.cache
TRUE to reuse disk caches of the big.matrix's x and asave from the initial building of the random forest, which may significantly reduce initialization time for large data sets. If TRUE, the user must ensure that the files ‘x’ and ‘x.desc’ in forest@cachepath have not been modified or deleted. Files ‘asave’ and ‘asave.desc’ must also be present if there are any numeric variables.
trace
0 for no verbose output. 1 to print verbose output on growing of trees, and a summary of the grown forest. 2 to print more verbose output on processing of individual nodes. Default: 0. Due to the way %dopar% handles the output of the tree-growing iterations, you may not see the verbose output in some GUIs like RStudio. For best results, run R from the command line in order to see all the verbose output.

Value

The object supplied as the forest argument, with additional trees grown.

Methods

signature(forest = "bigcforest")
Grow more trees in a classification random forest.

References

Breiman, L. (2001). Random forests. Machine learning, 45(1), 5-32.

Breiman, L. & Cutler, A. (n.d.). Random Forests. Retrieved from http://www.stat.berkeley.edu/~breiman/RandomForests/cc_home.htm.

Examples

Run this code
# Classify cars in the Cars93 data set by type (Compact, Large,
# Midsize, Small, Sporty, or Van).

# Load data.
data(Cars93, package="MASS")
x <- Cars93
y <- Cars93$Type

# Select variables with which to train model.
vars <- c(4:22)

# Run model, grow 30 trees.
forest <- bigrfc(x, y, ntree=30L, varselect=vars, cachepath=NULL)

# Grow 10 more trees.
forest <- grow(forest, x, ntree=10L)

Run the code above in your browser using DataLab