Skip to content
Advertisement

How to run LibSVM Classifier with 10 fold cross validation from Weka from Linux commandline?

I have installed Weka 3.7.12 on a linux machine with only commandline interface. I have downloaded the LibSVM.jar file as well and copied it in the same directory. How can I run the libsvm with 10 fold cross validation from the commandline in a similar way as in

java weka.classifiers.trees.RandomForest -I 100 -t ./data/iris.arff

Advertisement

Answer

I was able to get something together with the following command (on MacOSX, using Weka-3.6.12 and LIBSVM-3.20)

java -classpath ./weka.jar:./libsvm.jar weka.classifiers.functions.LibSVM -x <number of folds> -t <path to training data>

I ran the command from the weka-3.6.12 directory, and downloaded/moved the libsvm jar file to the same directory.

I used the information from the Weka Primer site here to find the parameter -x for the number of folds.

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement