BVDecompose Error
Warren Fernando <[email protected]>
| Newsgroups | gmane.comp.ai.weka |
|---|---|
| Message-ID | <CAJxavK-UY=doyncgBLiMy5bwmdXm1mdrFHE7ix1sdfFNCKp-fA@mail.gmail.com> |
Hi Guys,
I've been using the BVDecompose class on my datasets, and it works fine in
the CLI; however, when using it in java code with the API I persistently
get the error: Exception in thread "main" java.lang.Exception: Class
attribute must be nominal. I'm confused as to how to fix this as there are
no issues with any of the datasets in the WEKA GUI and the CLI. It should
be noted that the class attribute is recognised as a nominal value in both
the GUI and CLI.
My attributes are as follows:
@relation Ransomware
@attribute NtEnumerateValueKey numeric
@attribute SearchPathW numeric
@attribute SetFilePointerEx numeric
@attribute NtGetContextThread numeric
@attribute CreateRemoteThread numeric
@attribute NtQueryValueKey numeric
@attribute SetErrorMode numeric
@attribute GetSystemMetrics numeric
@attribute NtSetValueKey numeric
@attribute NtDelayExecution numeric
@attribute Thread32First numeric
@attribute SHGetSpecialFolderLocation numeric
@attribute NtTerminateThread numeric
@attribute NtCreateThread numeric
@attribute NtWriteVirtualMemory numeric
@attribute NtOpenKeyEx numeric
@attribute RegQueryInfoKeyW numeric
@attribute RegEnumValueA numeric
@attribute FindResourceExW numeric
@attribute DrawTextExW numeric
@attribute Class {0,1}
My code is as follows:
public RF() throws IOException, Exception {
BufferedReader reader = new BufferedReader(new
FileReader("src/MostEffective2018.arff"));
ArffLoader.ArffReader arff = new ArffLoader.ArffReader(reader);
int numFolds = 10;
data = arff.getData();
data.setClassIndex(data.numAttributes() - 1);
RandomForest rf = new RandomForest();
rf.setNumIterations(100);
rf.setMaxDepth(0);
rf.buildClassifier(data);
Evaluation eval = new Evaluation(data);
eval.crossValidateModel(rf, data, numFolds, new Debug.Random(1));
System.out.println(eval.recall(1));
System.out.println(eval.recall(0));
String file = new String("src/MostEffective2018.arff");
BVDecomposeSegCVSub bv = new BVDecomposeSegCVSub();
bv.setDataFileName(file);
bv.setClassIndex(data.numAttributes() - 1);
bv.setClassifier(rf);
System.out.println(bv.getClassIndex());
bv.decompose();
System.out.println(bv.toString());
}
Any help with this would be very much appreciated!
Thanks,
Warren
_______________________________________________
Wekalist mailing list -- [email protected]
Send posts to [email protected]
To unsubscribe send an email to [email protected]
To subscribe, unsubscribe, etc., visit https://list.waikato.ac.nz/postorius/lists/wekalist.list.waikato.ac.nz
List etiquette: http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html