Hi,
I have an existing example set. How can I effectively add a label attribute to the existing example set?
ExampleSet newExampleSet = .... (an existing example set);
// ADD LABEL ATTRIBUTE
Attribute label = AttributeFactory.createAttribute("label", Ontology.NOMINAL);
newExampleSet.getAttributes().setLabel(label);
// SET NOMINAL VALUE
Example e = newExampleSet.getExample(0);
e.setLabel(label.getMapping().mapString(clsName));
throws java.lang.ArrayIndexOutOfBoundsException: -1 on the last line.
SEVERE: Process failed: operator cannot be executed (-1). Check the log messages...
java.lang.ArrayIndexOutOfBoundsException: -1
at com.rapidminer.example.table.DoubleArrayDataRow.set(DoubleArrayDataRow.java:52)
at com.rapidminer.example.table.AbstractAttribute.setValue(AbstractAttribute.java:184)
at com.rapidminer.example.table.DataRow.set(DataRow.java:85)
at com.rapidminer.example.Example.setValue(Example.java:140)
at com.rapidminer.example.Example.setLabel(Example.java:178)
at ... last code of the example above ...
Thanks in advance for any help,
radone