perfCv
Cross-validation accuracy of given dataset and classifier
Contents
Syntax
- vRr=perfCv(DS, opt)
- vRr=perfCv(DS, opt, showPlot)
- [vRrOverall, tRrOverall, vRr, tRr, computedClass]=perfCv(...)
Description
vRr=perfCv(DS, opt) returns the cross-validation recognition rate based on the given options.
- vRr: validating recognition rate
- DS: Dataset
- DS.input: Input data (each column is a feature vector)
- DS.output: Output class (ranging from 1 to N)
- opt: optionsss
- opt.classifier: Classifier to be used
- opt.classifierOpt: Options for the classifier
- opt.cvOpt: options for cross validation (obtained from cvDataGen)
vRr=perfCv(DS, opt, 1) also plots the dataset and misclasified instances (if the dimension is 2).
[vRrOverall, tRrOverall, vRr, tRr, computedClass]=perfCv(...) returns more info about cross-validation:
- vRrOverall: Overall validating RR
- tRrOverall: Overall training RR
- vRr: Validating RR for all folds
- tRr: Training RR for all folds
- computedClass: The computed class of each data instance in DS
Example
DS=prData('iris'); opt=perfCv('defaultOpt'); vRr=perfCv(DS, opt, 1);