| c.grmforest | R Documentation |
Merges two or more grmforest objects grown on the same data and formula
into a single forest. This makes it straightforward to grow an ensemble in
chunks – across separate sessions, or across nodes of a compute cluster –
and assemble the pieces afterwards for a single call to varimp().
## S3 method for class 'grmforest'
c(...)
... |
Two or more |
Because out-of-bag membership is stored as row indices into the
shared data, merging requires no realignment: the indices from each
contributing forest remain valid in the combined object. The forests must
have been grown on data frames with the same number of rows and on an
identical formula, which is checked.
If you grow chunks separately, give each chunk a different seed, otherwise
every chunk will contain the same trees.
A single grmforest object containing all trees.
grmforest for GRM Forests, varimp
calculates the variable importance for GRM Forest
library(grmtree)
library(hlt)
data("asti", package = "hlt")
asti$resp <- data.matrix(asti[, 1:4])
f1 <- grmforest(resp ~ gender + group, data = asti,
control = grmforest.control(n_tree = 5, seed = 1))
f2 <- grmforest(resp ~ gender + group, data = asti,
control = grmforest.control(n_tree = 5, seed = 2))
big <- c(f1, f2)
print(big)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.