recursiveDepthBinning: Recursive Depth Binning

Description Usage Arguments Value

View source: R/tree_traversal_util.R

Description

Function to recursively traverse depths of a tree.

Usage

1
recursiveDepthBinning(node_list, depth, expected_num_children, binned_depths)

Arguments

node_list

Must be in the format of elements in the Ranger package's forest$split.varIDs, which represents one tree in the forest. Recursion is done by counting the number of terminal nodes at the current depth to anticipate the correct number of nodes at the next depth.

depth

Each recursive call must know the current depth in the tree.

expected_num_children

The number of nodes in the current depth must be anticipated, given the number of terminal nodes at the previous depth.

binned_depths

A list passed between recursive calls, to store results.

Value

A list of vectors, where elements correspond to depths, and vectors contain variable ID's of variables used to split at that depth.


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