extract_selected_tree_cuts: Extract cuts from selected tree only

View source: R/grf_helpers.R

extract_selected_tree_cutsR Documentation

Extract cuts from selected tree only

Description

Extracts cut information only from the tree at the specified selected depth. This provides a focused set of cuts from the tree that identified the subgroup meeting the dmin.grf criterion, rather than cuts from all trees.

Usage

extract_selected_tree_cuts(trees, selected_depth, maxdepth)

Arguments

trees

List. Policy trees (indexed by depth)

selected_depth

Integer. Depth of the selected tree (from best_subgroup$depth)

maxdepth

Integer. Maximum tree depth (for populating tree-specific slots)

Details

This function is used when return_selected_cuts_only = TRUE in grf.subg.harm.survival(). It returns:

  • tree1, tree2, tree3: Individual tree cuts (still populated for reference)

  • names1, names2, names3: Individual tree variable names

  • all: Cuts from the SELECTED tree only (not union of all trees)

  • all_names: Variable names from the SELECTED tree only

  • selected_depth: The depth that was selected

Value

List with cuts and names, structured similarly to extract_all_tree_cuts but with only the selected tree's cuts in the all field

Examples

## Not run: 
# When best_subgroup$depth = 2, only tree2 cuts are returned in $all
tree_cuts <- extract_selected_tree_cuts(trees, selected_depth = 2, maxdepth = 2)
tree_cuts$all
# Returns only cuts from depth 2 tree

## End(Not run)


forestsearch documentation built on Nov. 15, 2026, 9:06 a.m.