srcEval

Evaluation of SRC (sparse-representation classifier)

Contents

Syntax

Description

[computedClass, invDist, recogRate, hitIndex]=srcEval(DS, srcModel, plotOpt) returns the evaluation results of SRC

Example

DS=prData('iris');
trainSet.input=DS.input(:, 1:2:end); trainSet.output=DS.output(:, 1:2:end);
 testSet.input=DS.input(:, 2:2:end);  testSet.output=DS.output(:, 2:2:end);
opt=srcTrain('defaultOpt');
srcModel=srcTrain(trainSet, opt);
[computedClass, invDist, recogRate, hitIndex]=srcEval(testSet, srcModel);
fprintf('Outside recog rate = %g%% via %s\n', recogRate*100, opt.optimMethod);
opt.optimMethod='SPG';
opt.useUnitFeaVec=0;
srcModel=srcTrain(trainSet, opt);
[computedClass, invDist, recogRate, hitIndex]=srcEval(testSet, srcModel);
fprintf('Outside recog rate = %g%% via %s\n', recogRate*100, opt.optimMethod);
Outside recog rate = 92% via linProg
Outside recog rate = 94.6667% via SPG

See Also

srcTrain, srcPlot.


Top page   Next: simSequence.m   Prev:srcTrain.m