svmcEval

Evaluation of SVM (support vector machine) classifier

Contents

Syntax

Description

computedClass=svmcEval(DS, cPrm) returns values of SVM (support vector machine) classifier based on the given dataset DS and the SVM model cPrm.

Note that this function calls the mex files of libsvm directly, which are available at "http://www.csie.ntu.edu.tw/~cjlin/libsvm/".

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);
[svmPrm, logLike1, recogRate1]=svmcTrain(trainSet);
[computedClass, logLike2, recogRate2, hitIndex]=svmcEval(testSet, svmPrm);
fprintf('Inside recog. rate = %g%%\n', recogRate1*100);
fprintf('Outside recog. rate = %g%%\n', recogRate2*100);
Inside recog. rate = 100%
Outside recog. rate = 90.6667%

See Also

svmTrain.


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