Class: ClassificationDiscriminant
Cross-validated discriminant analysis classifier
cvmodel = crossval(obj)
cvmodel = crossval(obj,Name,Value)
creates
a partitioned model from cvmodel
= crossval(obj
)obj
, a fitted discriminant
analysis classifier. By default, crossval
uses 10-fold
cross validation on the training data to create cvmodel
.
creates
a partitioned model with additional options specified by one or more cvmodel
= crossval(obj
,Name,Value
)Name,Value
pair
arguments.
|
Discriminant analysis classifier, produced using |
Specify optional
comma-separated pairs of Name,Value
arguments. Name
is
the argument name and Value
is the corresponding value.
Name
must appear inside quotes. You can specify several name and value
pair arguments in any order as
Name1,Value1,...,NameN,ValueN
.
|
Object of class Use only one of these options at a time: Default: |
|
Holdout validation tests the specified fraction of the data,
and uses the rest of the data for training. Specify a numeric scalar
from |
|
Number of folds to use in a cross-validated classifier, a positive integer value greater than 1. Use only one of these options at a time: Default: 10 |
|
Set to Use only one of these options at a time: |
Create a classification model for the Fisher iris data, and
then create a cross-validation model. Evaluate the quality the model
using kfoldLoss
.
load fisheriris obj = fitcdiscr(meas,species); cvmodel = crossval(obj); L = kfoldLoss(cvmodel) L = 0.0200
Assess the predictive performance of obj
on
cross-validated data using the “kfold” methods and properties
of cvmodel
, such as kfoldLoss
.
You can create a cross-validation classifier directly from the
data, instead of creating a discriminant analysis classifier followed
by a cross-validation classifier. To do so, include one of these options
in fitcdiscr
: 'CrossVal'
, 'CVPartition'
, 'Holdout'
, 'KFold'
,
or 'Leaveout'
.
crossval
| fitcdiscr
| kfoldEdge
| kfoldfun
| kfoldLoss
| kfoldMargin
| kfoldPredict