Note: This page has been translated by MathWorks. Click here to see

To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

Cross-validated multiclass ECOC model for support vector machines (SVMs) and other classifiers

`ClassificationPartitionedECOC`

is a set of
error-correcting output codes (ECOC) models trained on cross-validated folds. Estimate
the quality of the cross-validated classification by using one or more
“kfold” functions: `kfoldPredict`

, `kfoldLoss`

, `kfoldMargin`

, `kfoldEdge`

, and `kfoldfun`

.

Every “kfold” method uses models trained on training-fold (in-fold)
observations to predict the response for validation-fold (out-of-fold) observations. For
example, suppose you cross-validate using five folds. In this case, the software
randomly assigns each observation into five groups of equal size (roughly). The
*training fold* contains four of the groups (roughly 4/5 of the
data), and the *validation fold* contains the other group (roughly
1/5 of the data). In this case, cross-validation proceeds as follows:

The software trains the first model (stored in

`CVMdl.Trained{1}`

) by using the observations in the last four groups and reserves the observations in the first group for validation.The software trains the second model (stored in

`CVMdl.Trained{2}`

) by using the observations in the first group and the last three groups. The software reserves the observations in the second group for validation.The software proceeds in a similar fashion for the third, fourth, and fifth models.

If you validate by using `kfoldPredict`

, the software computes
predictions for the observations in group *i* by using the
*i*th model. In short, the software estimates a response for every
observation by using the model trained without that observation.

You can create a `ClassificationPartitionedECOC`

model in two
ways:

`kfoldEdge` | Classification edge for cross-validated ECOC model |

`kfoldLoss` | Classification loss for cross-validated ECOC model |

`kfoldMargin` | Classification margins for cross-validated ECOC model |

`kfoldPredict` | Classify observations in cross-validated ECOC model |

`kfoldfun` | Cross-validate function using cross-validated ECOC model |

`ClassificationECOC`

| `CompactClassificationECOC`

| `crossval`

| `cvpartiton`

| `fitcecoc`