This function acts as a user-friendly interface to build a random forest
based on individual rpart
trees.
rforest( formula, data, method, weights = NULL, parms = NULL, control = NULL, ncand, ntrees, subsample = 1, track_oob = FALSE, keep_data = FALSE, red_mem = FALSE )
formula | object of the class |
---|---|
data | data frame containing the training data observations. |
method | string specifying the type of forest to build. Options are:
|
weights | optional name of the variable in |
parms | optional parameters for the splitting function, see
|
control | list of options that control the fitting details of the
|
ncand | integer specifying the number of randomly chosen variable candidates to consider at each node to find the optimal split. |
ntrees | integer specifying the number of trees in the ensemble. |
subsample | numeric in the range [0,1]. Each tree in the ensemble is
built on randomly sampled data of size |
track_oob | boolean to indicate whether the out-of-bag errors should be
tracked (TRUE) or not (FALSE). This option is not implemented for
All these errors are evaluated in
a weighted version if |
keep_data | boolean to indicate whether the |
red_mem | boolean whether to reduce the memory footprint of the
|
object of the class rforest
, which is a list containing the
following elements:
list of length equal to
ntrees
, containing the individual rpart
trees.
numeric vector of length equal to ntrees
,
containing the OOB error at each iteration (if track_oob = TRUE
).
the training data
(if keep_data = TRUE
).