| extract_selected_tree_cuts | R Documentation |
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.
extract_selected_tree_cuts(trees, selected_depth, maxdepth)
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) |
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
List with cuts and names, structured similarly to extract_all_tree_cuts
but with only the selected tree's cuts in the all field
## 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.