Description Usage Arguments Value
The 'prune' function allows the user to specify a value of the penalty for a given tree. This function uses the "weakest link" criteria in order to evaluate the order in which branches are pruned and gives the penalized value along with the unpenalized value. If testing data are provided for validation, then the penalized and unpenalized values from the testing data run down the tree structure are also provided.
1 2 |
tre |
sets the tree to be pruned |
a |
sets the value of the splitting penalty |
test |
the testing data to be used. Defaults to NULL. |
AIPWE |
indicator for AIPWE estimation. |
n0 |
minimum number of observations allowed in a treatment group. Defaults to 5. |
ctgs |
columns of categorical variables. |
train |
the training data used to create the tree |
summary of pruned branches and the associated value of the tree after pruning.
result |
contains columns: 'node.rm' which is the weakest link at each iteration of the pruning algorithm; 'size.tree' and 'n.tmnl' give number of total nodes and terminal nodes in each subtree; 'alpha' is the weakest link scoring criteria; 'V' and 'V.test' are the overall value of the tree for the training and tesing samples; 'V.a' and 'Va.test' give the penalized value for the training and testing samples. |
subtrees |
list of optimally pruned subtrees of 'tre' |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.