SVM classifier performance and flipping of arguments

2 次查看(过去 30 天)
Hi, I want to calculate the performance of SVM...i follow a very useful post of this forum.. SVM classifer
Here in the last there is an argument f..i have a question about that..what this argument means?? is it necessary to flip it? What is the benefit of this flipping. here is the code...Kindly tell me about the fliping of f .
shift = svm.ScaleData.shift;
scale = svm.ScaleData.scaleFactor;
Xnew = bsxfun(@plus,Xnew,shift);
Xnew = bsxfun(@times,Xnew,scale);
sv = svm.SupportVectors;
alphaHat = svm.Alpha;
bias = svm.Bias;
kfun = svm.KernelFunction;
kfunargs = svm.KernelFunctionArgs;
f = kfun(sv,Xnew,kfunargs{:})'*alphaHat(:) + bias;
f = -f; % flip the sign to get the score for the +1 class

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Statistics and Machine Learning Toolbox 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by