I am currently using trunk from April 30, 2011. The code is loosely
following the SGD training example from Mahout in Action. I have
instantiated the learner with the purpose of having a binary classifier
:
AdaptiveLogisticRegression learningAlgorithm = new
AdaptiveLogisticRegression( 2, FEATURES, new L1() );
Everything works fine (ie. the training) until I get to
learningAlogrithm.close() where I get the following exception:
learningAlgorithm.close() Error =
java.lang.ArrayIndexOutOfBoundsException
java.lang.IllegalStateException:
java.lang.ArrayIndexOutOfBoundsException
Exception = null
at
org.apache.mahout.classifier.sgd.AdaptiveLogisticRegression.trainWithBufferedExamples(AdaptiveLogisticRegression.java:144)
at
org.apache.mahout.classifier.sgd.AdaptiveLogisticRegression.close(AdaptiveLogisticRegression.java:196)
at
com.zensa.spinn3r.mahout.SnomedSDGClassificationTrainer.finishTraining(SnomedSDGClassificationTrainer.java:159)
at
com.spinn3r.sdg.trainer.Spinn3rSDGTrainer.process(Spinn3rSDGTrainer.java:170)
at
com.spinn3r.sdg.trainer.Spinn3rSDGTrainer.main(Spinn3rSDGTrainer.java:272)
Caused by: java.lang.ArrayIndexOutOfBoundsException
If I change the number of categories to 100, the close() works fine. Any
ideas on how to get around this and have a working binary classifier?
Thanks in advance.
Tim