Learn R Programming

solitude (version 1.1.3)

terminalNodesDepth: Depth of each terminal node of all trees in a ranger model

Description

Depth of each terminal node of all trees in a ranger model is returned as a three column tibble with column names: 'id_tree', 'id_node', 'depth'. Note that root node has the node_id = 0.

Usage

terminalNodesDepth(model)

Arguments

model

A ranger model

Value

A tibble with three columns: 'id_tree', 'id_node', 'depth'.

Details

This function may be parallelized using a future backend.

Examples

Run this code
# NOT RUN {
rf = ranger::ranger(Species ~ ., data = iris, num.trees = 100)
terminalNodesDepth(rf)
# }

Run the code above in your browser using DataLab