Learn R Programming

solitude (version 1.1.3)

terminalNodesDepthPerTree: Depth of each terminal node of a single tree in a ranger model

Description

Depth of each terminal node of a single tree in a ranger model. Note that root node has the id_node = 0.

Usage

terminalNodesDepthPerTree(treelike)

Arguments

treelike

Output of `ranger::treeInfo`

Value

data.table with two columns: id_node and depth

Examples

Run this code
# NOT RUN {
  rf = ranger::ranger(Species ~ ., data = iris)
  terminalNodesDepthPerTree(ranger::treeInfo(rf, 1))
# }

Run the code above in your browser using DataLab