mahout-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chandra Mohan, Ananda Vel Murugan" <>
Subject ArrayIndexOutOfBoundException in mahout SGD
Date Thu, 20 Jun 2013 05:25:00 GMT

I am running Mahout SGD. I read News group sample code and I have created my own code as my
requirements are slightly different.

I am getting ArrayIndexOutOfBound Exception while running AdaptiveLogisticRegression.train(actual,vector)
function. I looked into the stack trace and found the exact place where I am getting the exception.
There is a class called "DefaultGradient" in "org.apache.mahout.classifier.sgd" package and
exception occurs inside apply function,

This is the code for apply function.

Vector v = classifier.classify(instance);

    Vector r =;
    if (actual != 0) {
      r.setQuick(actual - 1, 1);
    r.assign(v, Functions.MINUS);
    return r;

I am getting the exception in r.setQuick(actual - 1, 1). Can someone help me in resolving
this exception? Thanks in advance.


  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message