srcTrain

Training the SRC (sparse-representation classifier)

Contents

Syntax

Description

cPrm=srcTrain(DS, opt, showPlot) returns the training 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);
[cPrm, logLike1, recogRate1]=srcTrain(trainSet);
[computedClass, logLike2, recogRate2, hitIndex]=srcEval(testSet, cPrm);
fprintf('Inside recog rate = %g%%\n', recogRate1*100);
fprintf('Outside recog rate = %g%%\n', recogRate2*100);
Inside recog rate = 100%
Outside recog rate = 92%

See Also

srcEval.


Top page   Next: srcEval.m   Prev:strCentroid.m