Hi!
I'm currently writing my own bunch of operators. One task would be to create a new attribute. I tried to copy this process from AttributeConstruction / ExpressionParser. Anyhow it doesn't work. When running my operator in RapidMiner I get the error "ArrayIndexOutOfBoundsException occured in 1st application of Add Point Mapping (Add Point Mapping)".
I'm using this code (minimal example):
public IOObject[] apply() throws OperatorException {
PointExampleSet exampleSet = getInput(PointExampleSet.class);
Attribute xAttr = AttributeFactory.createAttribute("x1", Ontology.REAL);
exampleSet.getExampleTable().addAttribute(xAttr);
exampleSet.getAttributes().addRegular(xAttr);
for (Example example : exampleSet) {
example.setValue(xAttr, 0);
}
return new IOObject[]{exampleSet};
}
For my project I had to extend ExampleSet, but I didn't override any method. What am I doing wrong?
[Edit:] As workaround I gave AttributeConstruction. I came up with the same error. So the problem seems to be in my Custom ExampleSet. But I haven't overridden anything there. *confused*.
I've written an Reader that creates my PointExampleSet from file(s). Therefore I'm using a MemoryExampleTable.
Best regards,
Michael