I updated and the exception is gone. Thanks for the quickness!

The way my data is currently organized is I have 2 users that rated 10 
different items. There is an 11th item they both rated highly.  Ratings are 
normalized to be between 0 and 1.  When I ask for recommendations for user A I 
want items other users who share similar tastes as A have rated highly, but 
that A has not yet rated. In other words, user A and B both like item 1 and 2, 
maybe A will also like item 3 since B likes it too.  Is slope one the correct 
algorithm to use in the case?


-Adam

-----Original Message-----
From: Sean Owen [mailto:[email protected]] 
Sent: Thursday, May 14, 2009 11:29 AM
To: [email protected]; Burnett, Adam
Subject: Re: Getting started

That's my bad. I just committed a fix that makes the result of these
methods in RandomUtils more reasonable for small values and should fix
this corner-ish case.

The org.apache.mahout.cf.taste stuff itself does not require Hadoop;
the Hadoop bindings are all in org.apache.mahout.cf.taste.hadoop.

2009/5/14 Burnett, Adam <[email protected]>:
> Hello Mahout community.  I'm just getting started in exploring how to
> integrate Mahout into my application. I've written a quick sample but
> I'm getting the following exception when trying to use the
> SlopeOneRecommender.
>
> INFO: Building average diffs...
> Exception in thread "main" java.lang.IllegalArgumentException
>        at
> org.apache.mahout.cf.taste.impl.common.RandomUtils.isNotPrime(RandomUtil
> s.java:93)
>        at
> org.apache.mahout.cf.taste.impl.common.RandomUtils.nextPrime(RandomUtils
> .java:81)
>        at
> org.apache.mahout.cf.taste.impl.common.RandomUtils.nextTwinPrime(RandomU
> tils.java:67)
>        at
> org.apache.mahout.cf.taste.impl.common.FastMap.rehash(FastMap.java:285)
>        at
> org.apache.mahout.cf.taste.impl.recommender.slopeone.MemoryDiffStorage.p
> runeInconsequentialDiffs(MemoryDiffStorage.java:254)
>        at
> org.apache.mahout.cf.taste.impl.recommender.slopeone.MemoryDiffStorage.b
> uildAverageDiffs(MemoryDiffStorage.java:227)
>        at
> org.apache.mahout.cf.taste.impl.recommender.slopeone.MemoryDiffStorage.<
> init>(MemoryDiffStorage.java:119)
>        at
> org.apache.mahout.cf.taste.impl.recommender.slopeone.SlopeOneRecommender
> .<init>(SlopeOneRecommender.java:65)
>
> I built Mahout from the 774566 revision of the trunk.  I have a
> MySQLJDBCDataModel that reads a custom table from my database.  One
> question I have is do I have to have the hadoop cluster running before
> attempting to use Mahout in my app?  Could not having it running cause
> the above error?  Any thoughts in how to proceed from here?  Thanks!
>
> Adam Burnett
>
>
>

Reply via email to