Description Usage Arguments Value See Also Examples
For a given randomForest
-object this function returns the variables
used for splitting in each not terminal node of the forest.
Basically applies getSplitVariablesTree
to each tree in the forest.
1 | getSplitVariablesForest(rFobject)
|
rFobject |
A |
A list
of the same length as number of trees in the forest. Each element
contains a vector
that is returned by getSplitVariablesTree
.
1 2 3 4 5 6 7 8 9 10 11 | ## data
YX <- simulateSNPdata(seed = 123)
## forest
rF <- randomForest(x = YX[ , -1], y = YX[ , 1], keep.forest = TRUE,
keep.inbag = TRUE, importance = TRUE, ntree = 500)
## split vars
splitVarsF <- getSplitVariablesForest(rF)
length(splitVarsF) == rF$ntree
splitVarsF[[1]] # first tree
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.