perfLoo

Leave-one-out accuracy of given dataset and classifier

Contents

Syntax

Description

recogRate=perfLoo(DS, classifier, classifierOpt) returns the leave-one-out recognition rate of the given dataset and classifier.

recogRate=perfLoo(DS, classifier, classifierOpt, 1) also plots the dataset and misclasified instances (if the dimension is 2).

[recogRate, computedClass]=perfLoo(...) also returns the computed class of each data instance in DS.

Example

DS=prData('random2');
DS=prData('iris');
DS.input=DS.input(3:4, :);	% Use the last 2 dims for plotting
showPlot=1;
tic
[recogRate, computed] = perfLoo(DS, 'knnc', [], showPlot);
fprintf('Elapsed time = %g sec\n', toc);
fprintf('Recog. rate = %.2f%% for %s dataSet\n', 100*recogRate, DS.dataName);
Elapsed time = 0.166156 sec
Recog. rate = 95.33% for iris dataSet

See Also

perfCv4classifier, perfCv.


Top page   Next: perfCv4classifier.m   Prev:perfLoo4audio.m