cvloss
Class: ClassificationTree
Classification error by cross validation
Syntax
Description
returns the cross-validated classification error (loss) for E
= cvloss(tree
)tree
,
a classification tree. The cvloss
method uses stratified
partitioning to create cross-validated sets. That is, for each fold, each partition
of the data has roughly the same class proportions as in the data used to train
tree
.
[___] = cvloss(
cross validates with additional options specified by one or more
tree
,Name,Value
)Name,Value
pair arguments, using any of the previous
syntaxes. You can specify several name-value pair arguments in any order as
Name1,Value1,…,NameN,ValueN
.
Input Arguments
Output Arguments
Examples
Alternatives
You can construct a cross-validated tree model with crossval
, and call kfoldLoss
instead of cvloss
. If you are
going to examine the cross-validated tree more than once, then the alternative can save
time.
However, unlike cvloss
, kfoldLoss
does not return
SE
,Nleaf
, or
BestLevel
. kfoldLoss
also
does not allow you to examine any error other than the classification error.