getLayerForest: retrieves the layer of (not terminal) nodes

Description Usage Arguments Details Value See Also Examples

Description

Returns the layer of every (not terminal) node in the forest, the root having layer 1.

Usage

1
getLayerForest(ancestryForestObj = list())

Arguments

ancestryForestObj

A list as it is returned by getAncestryForest.

Details

Applies getLayerTree to every list element.

Value

A list of length ntree. Each list element contains a vector where the single elements indicate the layer of the according (not terminal) nodes.

See Also

getLayerTree

Examples

 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

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