Description Usage Arguments Details Value See Also Examples
Returns the layer of every (not terminal) node in the forest, the root having layer 1.
1 | getLayerForest(ancestryForestObj = list())
|
ancestryForestObj |
A |
Applies getLayerTree
to every list element.
A list
of length ntree
. Each list element contains a vector where
the single elements indicate the layer of the according (not terminal) nodes.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | ## data
YX <- simulateSNPdata(seed = 123)
## forest
rF <- randomForest(x = YX[ , -1], y = YX[ , 1], keep.forest = TRUE,
keep.inbag = TRUE, importance = TRUE, ntree = 500)
## ancestry
aF <- getAncestryForest(rF)
## layer
lF <- getLayerForest(aF)
length(lF) == rF$ntree
lF[[1]] ## layers of not terminal nodes for the first tree
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.