You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@mahout.apache.org by Tim Snyder <ti...@proinnovations.com> on 2011/05/01 12:18:40 UTC

AdaptiveLogisticRegression.close() ArrayIndexOutOfBoundsException

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


Re: AdaptiveLogisticRegression.close() ArrayIndexOutOfBoundsException

Posted by Ted Dunning <te...@gmail.com>.
Can you put your code on github?

There is a detail that slipped somewhere and I can't guess where it is.
 Your constructor is correct for a binary classifier, but I can't say much
else.

How much data, btw, did you pour in?

On Sun, May 1, 2011 at 3:18 AM, Tim Snyder <ti...@proinnovations.com> wrote:

> 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
>
>