crossValidate

Cross validation for classifier performance evaluation

Contents

Syntax

Description

[tRrMean, vRrMean, tRr, vRr]=crossValidate(DS, cvPrm) generates a classifier's performance based on m-fold cross validation.

Example

10-fold cross-validation of Iris dataset using GMMC

DS=prData('iris');
cvPrm=crossValidate('defaultOpt');
cvPrm.foldNum=10;
cvPrm.classifier='gmmc';	% GMM-based classifier
showPlot=1;
figure; [tRrMean, vRrMean, tRr, vRr]=crossValidate(DS, cvPrm, showPlot);
Fold = 1/10
Fold = 2/10
Fold = 3/10
Fold = 4/10
Fold = 5/10
Fold = 6/10
Fold = 7/10
Fold = 8/10
Fold = 9/10
Fold = 10/10
Training RR=97.56%, Validating RR=96.67%, classifier=gmmc, no. of folds=10

Leave-one-out test of Iris dataset using QC

DS=prData('iris');
cvPrm=crossValidate('defaultOpt');
cvPrm.foldNum=inf;
cvPrm.classifier='qc';	% Quadratic classifier
showPlot=1;
figure; [tRrMean, vRrMean, tRr, vRr]=crossValidate(DS, cvPrm, showPlot);
Fold = 15/150
Fold = 30/150
Fold = 45/150
Fold = 60/150
Fold = 75/150
Fold = 90/150
Fold = 105/150
Fold = 120/150
Fold = 135/150
Fold = 150/150
Training RR=98.00%, Validating RR=97.33%, classifier=qc, no. of folds=150

Top page   Next: confMatPlot.m   Prev:cvDataGen.m