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

Quote:
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):


Code:
optimization finished, #iter = NNNN
nu = XXXXXXX
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?

Thanks.

-Samir
Samir,
you just have to set computed model to a variable:

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

Code:
[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