When we try to use LIBSVM through WEKA, we might encounter the problem of libsvm.jar not in the classpath. Here, I’d like to describe how to set up Weka and LIBSVM for weka.
1) Download weka-3.5.7.zip from http://www.cs.waikato.ac.nz/ml/weka/, and unzip it to /path/to/weka-3.5.7
2) Download libsvm-2.85.zip from http://www.csie.ntu.edu.tw/~cjlin/libsvm/, and unzip it into /path/to/libsvm-2.85
3) Copy weka.gif in the /path/to/weka-3.5.7 to /usr/share/pixmaps. (need to be root)
4) Right click on the Gnome top tool bar -> Add to panel –> Custom Application Launcher
5) In the command, enter:
java -Xmx1600m -classpath $CLASSPATH:/path/to/weka-3-5-7/weka.jar:/path/to/libsvm-2.84/java/libsvm.jar weka.gui.GUIChooser
6) In the icon, there should be weka.gif in the list due to step 3 above.
7) Change WEKA Java maximum heap size as appropriate in the command line above by modifying -Xmx1600m, where 1600m = 1.6GB.
[Update: March 21, 2008] If you don’t do any feature selection or preprocessing, don’t bother using WEKA for your LIBSVM experiment. Writing your own Java interface to LIBSVM will take less momory consumption and faster execution time, or you just run LIBSVM from the command line.
[Update: April 8, 2008] Feature selection is an important step for data mining/text mining tasks. A list here http://elvis.slis.indiana.edu/fetched/kiduk/0409.html explains how to use feature selection in Weka.