rforest: Random forest

View source: R/rforest.R

rforestR Documentation

Random forest

Description

A poor man's implementation of random forest (Breiman, 2001) with the option to incorporate random rotations as described in Blaser and Fryzlewicz (2016).

Usage

rforest(X, y, mtry = NULL, ntree = 500, rotate = FALSE, ...)

Arguments

X

A data frame or a matrix of predictors.

y

Numeric vector of response value. For binary outcomes, y should be mapped to {0, 1}. Note that multiclass outcomes are not supported.

mtry

Integer specifying the number of variables randomly sampled as candidates splitters at each node in a tree. Note that the default values are different for classification (floor(sqrt(p)) where p is number of columns of X) and regression floor(p/3)).

ntree

Integer specifying the number of trees to grow. This should not be set to too small a number, to ensure that every input row gets predicted at least a few times. Default is 500.

rotate

Logical indicating whether or not to randomly rotate the feature values prior to fitting each tree. Default is FALSE which results in a traditional random forest.

...

Optional arguments to be passed on to randomForest (e.g., nodesize = 10).

Value

An object of class "rforest", which is essentially a list of rftree objects.

References

Breiman, Leo. (2001), Random Forests, Machine Learning 45(1), 5-32.

Rico Blaser and Piotr Fryzlewicz. Random rotation ensembles. Journal of Machine Learning Research, 17:1–26, 2016.


bgreenwell/treemisc documentation built on Oct. 26, 2022, 12:56 a.m.