Usage
"drandomForest"(formula, data=NULL, ..., ntree=500, na.action=na.fail, nExecutor, trace=FALSE, completeModel=FALSE, setSeed)
"drandomForest"(x, y=NULL, xtest=NULL, ytest=NULL, ntree=500, mtry=if (!is.null(y) && !is.factor(y) && !is.dframe(y)) max(floor(ncol(x)/3), 1) else floor(sqrt(ncol(x))), replace=TRUE, classwt=NULL, cutoff, strata, sampsize = if (replace) nrow(x) else ceiling(.632*nrow(x)), nodesize = if (!is.null(y) && !is.factor(y) && !is.dframe(y)) 5 else 1, maxnodes=NULL, importance=FALSE, localImp=FALSE, nPerm=1, proximity=FALSE,norm.votes=TRUE, keep.forest=TRUE, nExecutor, trace=FALSE, completeModel=FALSE, ...,
setSeed, formula, na.action = na.fail)
Arguments
data
a data frame or dframe which contains samples.
na.action
A function to specify the action to be taken if NAs
are found. (NOTE: If given, this argument must be named.)
formula
a formula describing the model to be fitted.
It must be a simple formula without any arithmetic operation
among columns.
x
when a data frame or a matrix of predictors assigned to x,
its size should not be bigger than 2GB. For bigger datasets, darray
should be used. darray does not support categorical data. Therefore,
dframe and the first interface should be used for classification
problems of large datasets with categorical data.
y
a response vector. If a factor, classification is assumed,
otherwise regression is assumed. If omitted, drandomForest
will run in unsupervised mode. When x is a darray), y
should be also a darray with a single column.
xtest
a data frame or matrix (like x) containing
predictors for the test set. When x is a darray,
it should be of the same type.
ytest
response for the test set. Its type should be consistent
with y. Moreover, it should have a single column.
ntree
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.
mtry
Number of variables randomly sampled as candidates at each
split. Note that the default values are different for
classification (sqrt(p) where p is number of variables in x)
and regression (p/3)
replace
Should sampling of cases be done with or without
replacement?
classwt
Priors of the classes. Need not add up to one.
Ignored for regression.
cutoff
(Classification only) A vector of length equal to
number of classes. The 'winning' class for an observation is the
one with the maximum ratio of proportion of votes to cutoff.
Default is 1/k where k is the number of classes (i.e., majority vote
wins).
strata
A (factor) variable that is used for stratified sampling.
sampsize
Size(s) of sample to draw. For classification, if
sampsize is a vector of the length the number of strata, then
sampling is stratified by strata, and the elements of sampsize
indicate the numbers to be drawn from the strata.
nodesize
Minimum size of terminal nodes. Setting this number
larger causes smaller trees to be grown (and thus take less time).
Note that the default values are different for classification (1)
and regression (5).
maxnodes
Maximum number of terminal nodes trees in the forest
can have. If not given, trees are grown to the maximum possible
(subject to limits by nodesize). If set larger than maximum
possible, a warning is issued.
importance
Should importance of predictors be assessed?
localImp
Should casewise importance measure be computed?
(Setting this to TRUE will override importance.)
nPerm
Number of times the OOB data are permuted per tree for
assessing variable importance. Number larger than 1 gives slightly
more stable estimate, but not very effective. Currently only
implemented for regression.
proximity
a logical value which indicates if the proximity measure
among the rows should be calculated. It is FALSE by default because
it is very memory inefficient. Moreover, it is calculated only on
'out-of-bag' data
norm.votes
If TRUE (default), the final result of votes
are expressed as fractions. If FALSE, raw vote counts are
returned (useful for combining results from different runs).
Ignored for regression.
keep.forest
If set to FALSE, the forest will not be
retained in the output object.
nExecutor
a positive integer number indicating the number of tasks for running the function. To have optimal performance, it is recommended to have this number smaller than or equal to the total number of cores.
trace
when this argument is true, intermediate steps of the progress are displayed.
completeModel
when it is FALSE (default), the output values that preserve information per sample are discarded. They are 'oob.times', 'votes', 'predicted', 'confusion', 'err.rate', 'mse', 'rsq', 'proximity', and 'test'. This feature is intended to keep the size of the output model small.
...
optional parameters to be passed to the low level function.
setSeed
if setSeed is a valid integer, the output model will be deterministic assuming nExecutor parameter does not change