extract_forest: Extract the forest

View source: R/a.R

extract_forestR Documentation

Extract the forest

Description

Extracts the whole decision forest as a left-first, depth-first walk over all vertices.

Usage

extract_forest(x)

Arguments

x

A model to convert; has to hold the forest (forest=TRUE flag passed to fru).

Value

A data frame with the forest structure. Each row represents a step in a left-first, depth-first walk over the forest. The Feature column holds, for branches, the feature used for a split, or NA, for leaves. Similarly, Threshold and Subset columns hold the splitting criterion for branches; they exists only when holding any data. For a numerical or integer split, observations with values strictly larger than threshold are sent left. For a subset split, observations with values in the threshold subsets are sent left. Logical splits have a fixed criterion, TRUEs are sent left. This way, they have no corresponding criterion column. Finally, leaf visits have their vote stored in the Vote colum.

Note

This function will solidify the model object.


fru documentation built on Aug. 20, 2026, 9:09 a.m.

Related to extract_forest in fru...