binForestByDepth: Bin Forest by Depth

Description Usage Arguments Value

View source: R/tree_traversal_util.R

Description

Given a forest object from the ranger package, this function will bin the forest into depths. This is a helper function for the 'calculateAMDMS' function.

Usage

1
binForestByDepth(ranger_obj)

Arguments

ranger_obj

A ranger object from the ranger package, which was created with param write.forest set to TRUE. In other words, it must have a 'forest' property.

Value

A list with 3 elements. The first is a list of vectors - one for each independent variable ocurring in the forest (this may not be the complete set of independent variables, but we will account for any variables that do not occur in the forest later). Each vector contains all minimal depths of maximal subtrees in the forest, for the corresponding independent variable. The second element is a vector of tree heights 'forest_depths'. The third element is a set of variable id's for matching to independent variable names.


climbeR documentation built on May 2, 2019, 3:37 p.m.