Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use SVM in Weka?

Tags:

java

libsvm

weka

I'm trying to use the svm classifier in weka. When I click on the libsvm classifier and try to train a model based on some provided training data, I get the error

libsvm classes not in CLASSPATH.

The weka website has some information on how to fix this but I'm not sure how to execute them.

http://weka.wikispaces.com/LibSVM

I got the libsvm.jar file from the link provided. I'm not sure which file to put it in.

like image 460
Shaayaan Sayed Avatar asked Oct 21 '22 02:10

Shaayaan Sayed


2 Answers

You have to set your classpath variable so it knows where to find that jar on your local machine.

If you are on windows right-click computer->properties->advanced system settings->environment variables and set it under system variables. Chances are you already have a classpath variable; so just add the path of your jar file to the end.

Reference: http://weka.wikispaces.com/CLASSPATH

like image 194
jaesanx Avatar answered Nov 01 '22 16:11

jaesanx


Adding to Rob's answer: suit your values as below. This is how it is saved for me.

  • Variable Name: CLASSPATH
  • Variable value: C:\Program Files (x86)\Weka-3-6\libsvm-3.20\java\libsvm.jar
like image 40
Sheetal Kaul Avatar answered Nov 01 '22 15:11

Sheetal Kaul