
Prunes the trees in a YARF mode. This is an irreversible modification to the tree structure.
Source:R/YARF_pruning.R
prune_YARF_model.RdPrunes the trees in a YARF mode. This is an irreversible modification to the tree structure.
Arguments
- yarf_mod
The YARF model whose trees are to be pruned.
- prune_if_script
A custom javascript function (see below) which determines the pruning of a node (i.e. deletes the node's children and sets the node to a leaf and then sets a y_hat using the assign function).
function pruneIf(node){ //node is of type YARF.YARFNode
...
return boolean //true if this node is to be pruned }
- trees_to_prune
An array of indices which specify which of the trees to prune. The default is
NULLwhich means all of them.