I'm trying to use a classifier LibSVM-based using Weka, but i got this error:
Exception in thread "main" weka.core.UnsupportedAttributeTypeException:weka.classifiers.functions.LibSVM: Cannot handle numeric class!
at weka.core.Capabilities.test(Unknown Source)
at weka.core.Capabilities.test(Unknown Source)
at weka.core.Capabilities.test(Unknown Source)
at weka.core.Capabilities.testWithFail(Unknown Source)
at weka.classifiers.functions.LibSVM.buildClassifier(Unknown Source)
at imgclassifier.ImgClassifier.main(ImgClassifier.java:45)
Java Result: 1
this is my code:
try {
File f = new File("australian.txt");
LibSVMLoader loader = new LibSVMLoader();
loader.setSource(f);
Instances i = loader.getDataSet();
LibSVM svm = new LibSVM();
svm.buildClassifier(i);
}catch (IIOException e) {
e.printStackTrace();
}
australian.txt is an example taken here:LibSVM DataSets can anyone explain me where is the error? thanks in advance