getSplitVariablesForest: retrieves split variables from forest

Description Usage Arguments Value See Also Examples

Description

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.

Usage

1

Arguments

rFobject

A randomForest-object that is returned by randomForest

Value

A list of the same length as number of trees in the forest. Each element contains a vector that is returned by getSplitVariablesTree.

See Also

getSplitVariablesTree

Examples

 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

adibender/rFtools documentation built on May 14, 2019, 5:13 a.m.