H M Ishrar Hussain
2007-01-16 12:31:05 UTC
I have been trying to make up an Instance object for classification
using codes similar to the followings:
Attribute abcd = new Attribute("abcd");
Instance xyz = new Instance(2);
xyz.setValue(abcd, 1.0);
...
But, everytime I am ending up with with the following runtime error:
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: -1
at weka.core.Instance.setValue(Instance.java:643)
at weka.core.Instance.setValue(Instance.java:716)
As I trace back, I find setValue() method of the Instance class calls
index() method of the Attribute class that always returns "-1" as the
index of the attribute. As a result it throws
ArrayOutOfBoundException.
The problem is really bugging me at the moment. Can anyone tell me how
to fix this problem? Please reply ASAP. Thanks in advance.
Regards,
H M Ishrar Hussain
Department of Computer Science and Software Engineering
Concordia University
Montreal, Canada
using codes similar to the followings:
Attribute abcd = new Attribute("abcd");
Instance xyz = new Instance(2);
xyz.setValue(abcd, 1.0);
...
But, everytime I am ending up with with the following runtime error:
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: -1
at weka.core.Instance.setValue(Instance.java:643)
at weka.core.Instance.setValue(Instance.java:716)
As I trace back, I find setValue() method of the Instance class calls
index() method of the Attribute class that always returns "-1" as the
index of the attribute. As a result it throws
ArrayOutOfBoundException.
The problem is really bugging me at the moment. Can anyone tell me how
to fix this problem? Please reply ASAP. Thanks in advance.
Regards,
H M Ishrar Hussain
Department of Computer Science and Software Engineering
Concordia University
Montreal, Canada