mahout-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mario Levitin <mariolevi...@gmail.com>
Subject Re: org.apache.mahout.math.IndexException
Date Fri, 18 Apr 2014 21:03:12 GMT
In my dataset ID's are strings so I use MemoryIDMigrator. This migrator
produces large longs.
I'm not doing any translation.

I could not understand why there is a cast to int in the Mahout code. This
will produce errors for large long values.


On Fri, Apr 18, 2014 at 8:06 PM, Ted Dunning <ted.dunning@gmail.com> wrote:

> Are you translating the ID's down into a range that will fit into int's?
>
>
>
>
> On Thu, Apr 17, 2014 at 3:02 PM, Mario Levitin <mariolevitin@gmail.com
> >wrote:
>
> > Hi,
> >
> > I'm trying to run the ALS algorithm. However, I get the following error:
> >
> > Exception in thread "pool-1-thread-3"
> > org.apache.mahout.math.IndexException: Index -691877539 is outside
> > allowable range of [0,2147483647)
> > at org.apache.mahout.math.AbstractVector.set(AbstractVector.java:395)
> > at
> >
> >
> org.apache.mahout.cf.taste.impl.recommender.svd.ALSWRFactorizer.sparseUserRatingVector(ALSWRFactorizer.java:305)
> >
> > At line 305 in ALSWRFactorizer.java, there is the following code
> >
> > ratings.set((int) preference.getItemID(), preference.getValue());
> >
> > My suspicion is that the error results from the casting to int in the
> above
> > line. Item IDs in mahout are long, so if you cast a long (which does not
> > fit into an int) then you will get negative numbers and hence the error.
> >
> > However, this explanation also seems to me implausible since I don't
> think
> > such an error exists in Mahout code.
> >
> > Any help will be appreciated.
> > Thanks
> >
>

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