prune
Class: RegressionTree
Produce sequence of regression subtrees by pruning
Syntax
tree1 = prune(tree)
tree1 = prune(tree,Name,Value)
Description
creates a
copy of the regression tree tree1
= prune(tree
)tree
with its optimal pruning sequence filled
in.
creates a pruned tree with additional options specified by one tree1
= prune(tree
,Name,Value
)Name,Value
pair argument. You can specify several name-value pair arguments in any order as
Name1,Value1,…,NameN,ValueN
.
Input Arguments
|
A regression tree created with |
Name-Value Arguments
Optional comma-separated pair of Name,Value
arguments, where
Name
is the argument name and Value
is the corresponding
value. Name
must appear inside single quotes (''
). You can
specify only one name-value pair argument.
|
A numeric scalar from |
|
A numeric scalar from |
|
A numeric vector with elements from |
Output Arguments
|
A regression tree. |
Examples
Tips
tree1 = prune(tree)
returns the decision treetree1
that is the full, unprunedtree
, but with optimal pruning information added. This is useful only if you createdtree
by pruning another tree, or by usingfitrtree
with pruning set'off'
. If you plan to prune a tree multiple times along the optimal pruning sequence, it is more efficient to create the optimal pruning sequence first.