Input Arguments

Name-Value Pair Arguments

Specify optional comma-separated pairs of Name,Value arguments.
Name is the argument
name and Value is the corresponding
value. Name must appear
inside single quotes (' ').
You can specify several name and value pair
arguments in any order as Name1,Value1,...,NameN,ValueN.

'CVPartition'

Object of class cvpartition,
created by the cvpartition function. crossval splits
the data into subsets with cvpartition.

Use only one of these options at a time: 'CVPartition', 'Holdout', 'KFold',
or 'Leaveout'.

Default: []

'Holdout'

Holdout validation tests the specified fraction of the data,
and uses the rest of the data for training. Specify a numeric scalar
from 0 to 1. Use only one of
these options at a time: 'CVPartition', 'Holdout', 'KFold',
or 'Leaveout'.

'KFold'

Number of folds to use in a cross-validated classifier, a positive
integer.

Use only one of these options at a time: 'CVPartition', 'Holdout', 'KFold',
or 'Leaveout'.

Default: 10

'Leaveout'

Set to 'on' for leave-one-out cross validation.

Use only one of these options at a time: 'CVPartition', 'Holdout', 'KFold',
or 'Leaveout'.

Examples

Create a classification model for the Fisher iris data, and
then create a cross-validation model. Evaluate the quality the model
using kfoldLoss.

Alternatives

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'.