Orange Forum • View topic - Question about SVM

Question about SVM

A place to ask questions about methods in Orange and how they are used and other general support.

Question about SVM

Postby keithwai » Wed Oct 07, 2009 18:36

Hello all,

I am new to Orange and data mining, I am just a student. I like python and recently I start to learn machine learning to prepare for a research topic. I have to learn SVM and I know there is a good library out there called libsvm. I read some document here and seems like Orange embedded this library. However, I also found two separate pages about the SVM usage:

http://www.ailab.si/orange/doc/reference/SupportVectorMachines.htm

http://www.ailab.si/orange/doc/modules/orngSVM.htm

It seems to me these two are different libraries/modules, so if I am to apply sth same as libsvm, which module should I use?

Another question, refer to the document on the libsvm site: http://www.csie.ntu.edu.tw/~cjlin/papers/guide/guide.pdf
Can anyone give me a very simple example that mimic the example on the page 9 of the document using Orange (by scripting)?

Thanks alot.

Postby bgbg » Thu Oct 08, 2009 12:39

Code: Select all
import orange
import orngSVM

dataTraining = orange.ExampleTable('trainingData.tab')
dataValidation = orange.ExampleTable('validationData.tab')

learner = orngSVM.SVMLearner() #add your options here


#training
classifier = learner(dataTraining)




# testing
print 'observed\tpredicted'
for e in dataValidation:
    print e.getclass().value, '\t', classifier.(e, orange.GetValue).value
   
   



As to your first question, it seems that these are two interfaces to the same functionality. However, orngSVM contains the very useful SVMLearnerEasy, which is similar in functionality to easy.py from the document you have mentioned (without graphs).


Return to Questions & Support