Assuming you are calling the weka classes in your Java code, you'll need to know that internally, Weka handles all values as doubles.
When you create the Attribute
, you pass it an array of strings that lists the possible nominal values. The double
that classification returns is the index of the chosen attribute in the original array. So if you had code that looked like this:
String[] attributeValues = {"a", "b", "c"};
Attribute a = new Attribute("attributeName", attributeValues);
and classifyInstance()
returned 2, then the class it chose would be attributeValues[2]
or "c".