produce sequence of classification subtrees by pruning -凯发k8网页登录
class:
produce sequence of classification subtrees by pruning
syntax
tree1 = prune(tree)
tree1 = prune(tree,name,value)
description
creates a copy of the classification 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 classification tree created with |
name-value arguments
specify optional pairs of arguments as
name1=value1,...,namen=valuen
, where name
is
the argument name and value
is the corresponding value.
name-value arguments must appear after other arguments, but the order of the
pairs does not matter.
before r2021a, use commas to separate each name and value, and enclose
name
in quotes.
|
a numeric scalar. |
|
a numeric scalar from |
|
a numeric vector with elements from |
output arguments
|
a classification 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 using thefitctree
function 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.