Thread: Libsvm
View Single Post
Old 08-29-2012, 10:52 AM
dvs79 dvs79 is offline
Join Date: Jul 2012
Location: Moscow, Russia
Posts: 24
Default Re: Libsvm

Originally Posted by samirbajaj View Post
Maybe I should create a separate thread for this, but I'm still stuck at trying to figure out how to get libsvm to compute E_in.

Here is a typical output (I use the command-line Java tools):

optimization finished, #iter = NNNN
obj = YYYYY, rho = ZZZZZ
nSV = A, nBSV = B
Total nSV = C
The alphas are not displayed. But I was really hoping that libsvm would compute E_in automatically (it has everything it needs to do so).

Is there a magical switch that I am missing?


you just have to set computed model to a variable:

MyModel = svmtrain(y,X,[options])
and then use this model to predict values for your test dataset:

[predicted_labels, accuracy] = svmpredict(y_test, X_test, MyModel)
To obtain E_in, use in svmpredict the same dataset that you have used for training.

PS I assume using Matlab/Octave, but for other interfaces procedures is the same, difference only in sintax, I believe.
Reply With Quote