Description Usage Arguments Value References See Also Examples
Build a classification random forest model using Leo Breiman and Adele Cutler's algorithm, with enhancements for large data sets. This implementation uses the bigmemory package for disk-based caching during growing of trees, and the foreach package to parallelize the tree-growing process.
1 2 3 4 5 |
x |
A |
y |
An integer or factor vector of response variables. |
ntrees |
The number of trees to be grown in the forest, or 0 to build an empty forest to which trees can be added using |
varselect |
An integer vector specifying which columns in |
varnlevels |
An integer vector with elements specifying the number of levels in the corresponding variables in use, or 0 for numeric variables. Used only when |
nsplitvar |
The number of variables to split on at each node. Default: If |
maxeslevels |
Maximum number of levels for categorical variables for which exhaustive search of possible splits will be performed. Default: 11. This will amount to searching (2 ^ (11 - 1)) - 1 = 1,023 splits. |
nrandsplit |
Number of random splits to examine for categorical variables with more than maxeslevels levels. Default: 1,023. |
maxndsize |
Maximum number of examples in each node when growing the trees. Nodes will be split if they have more than this number of examples. Default: 1. |
yclasswts |
A numeric vector of class weights, or |
printerrfreq |
An integer, specifying how often error estimates should be printed to the screen. Default: error estimates will be printed every 10 trees. |
printclserr |
|
cachepath |
Path to folder where data caches used in building the forest can be stored. If |
trace |
|
An object of class "bigcforest"
containing the specified number of trees, which are objects of class "bigctree"
.
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.
1 2 3 4 5 6 7 8 9 10 11 12 13 | # 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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.