How to use libsvm in weka

3.4k Views Asked by At

I am unable to use lib svm in weka.

I have followed the steps here and did much googling but to no avail.

How to use LibSVM with Weka in my Java code?

I would just need this code

LibSVM classifier = new LibSVM()

to work.

But however it keeps on cannot detect the LibSVM library

enter image description here

What am i doing wrong?

i cannot get the jar

You can get the wlsvm.jar from here: http://www.cs.iastate.edu/~yasser/wlsvm/

from here as proposed in the solution.

Is there anyway i can install LIBSVM into weka using the GUI then extracting the jar out?

3

There are 3 best solutions below

0
On

I solved the problem by downloading and adding this to my library.

http://mvnrepository.com/artifact/nz.ac.waikato.cms.weka/LibSVM/1.0.6

0
On

Download LIBSVM library and add its path. now open weka, add your data set, go to classification, go to functions, and choose LIbSVM. for improving Accuracy you can use cross validation.

0
On

The following steps describe how to use libsvm in Weka GUI.

1. Download LIBSVM from https://www.csie.ntu.edu.tw/~cjlin/libsvm/.
2. Extract the zip file and paste the folder into Program Files in C Drive.
3. Copy the file path C:\Program Files\libsvm-3.22\java\libsvm.jar.
4. Go to System Properties -> Advanced -> Environment Variables.
5. Click New -> Add Variable Name as CLASSPATH and Add Variable value as C:\Program Files\libsvm-3.22\java\libsvm.jar.
6. Click ok.
7. Open Weka GUI and access LIBSVM.