View source: R/grmforest-control.R
| grmforest.control | R Documentation |
Creates a control object governing how a forest of graded response model trees is grown: how observations are resampled for each tree, how many partitioning variables are offered at each split, how failures are handled, and how the work is distributed across processor cores.
grmforest.control(
n_tree = 100,
sampling = c("subsample", "bootstrap"),
sample_fraction = NULL,
mtry = NULL,
remove_dead_trees = TRUE,
control = grmtree.control(),
n_cores = 1,
seed = NULL,
verbose = FALSE
)
n_tree |
Number of trees in the forest (default: 100). |
sampling |
Resampling scheme for each tree: |
sample_fraction |
Fraction of the original sample drawn for each tree.
If |
mtry |
Number of partitioning variables randomly offered as split
candidates at each node. |
remove_dead_trees |
Logical. If |
control |
Control parameters for the individual trees, created by
|
n_cores |
Number of processor cores used to fit trees in parallel (default: 1). Results do not depend on this value: all resampling indices are drawn in the master process before any fitting begins, so a forest grown on 20 cores is identical to the same forest grown on one. |
seed |
Random seed for reproducibility (default: |
verbose |
Logical. Report progress while growing the forest
(default: |
A list of class grmforest_control.
Naive parallelisation of a tree ensemble can silently change results,
because each worker inherits or advances the random number stream
differently; in the worst case several workers draw identical resamples and
the ensemble carries far less variance than it appears to. This
implementation avoids the problem structurally: the full list of n_tree
resampling index vectors is generated serially under seed before any tree
is fitted, and tree fitting is a deterministic function of those indices.
n_cores therefore affects only elapsed time.
Strobl, C., Boulesteix, A.-L., Zeileis, A., & Hothorn, T. (2007). Bias in random forest variable importance measures. BMC Bioinformatics, 8, 25.
grmtree.control creates a control object for
grmtree, plot.grmtree creates plot for the grmtree object,
grmforest for GRM Forests,
# Bagged ensemble of 50 trees
ctrl <- grmforest.control(n_tree = 50)
# Random-forest style, 4 candidate variables per split, 4 cores
ctrl <- grmforest.control(n_tree = 100, mtry = 4, n_cores = 4, seed = 123)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.