mahout-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sean Owen <>
Subject Re: Item-based Collaborative Filtering
Date Mon, 25 May 2009 06:32:49 GMT
Yes you might want to start with the link Otis posted, and read that
whole page, and check a few of the key classes it mentions. I think
you can gain an understanding of the basics there, and we can help
with more advanced questions.

On Mon, May 25, 2009 at 7:08 AM, Nagu <> wrote:
> I read the notes in the below links. I have a couple of questions:
> 1. Do I have to create, and mimic the
> java code in the examples/grouplens directory? Or I just put all the
> suggested code (from the below links in examples section) in one single
> .java file?

You could do either. I might start with the easiest approach, which is
to copy the sample code off of the page Otis sent, put it into the
main() method of some class, and run it. You do not need to create
your own implementations to start, just use existing ones, as shown in
the sample code.

> 2. How do I save item similarity matrix?

Presumably you are using FileDataModel as in the sample code. See its
javadoc for details of how it reads the data: it's a CSV file where
lines are of the form 'userID,itemID,pref'

> 3. How do I save and access recommendations for all customers ID?

This part is up to you, the caller.

> 4. What if I want to test recommendations with Pearson correlation metric
> with other metrics, e.g. cosine or modified cosine transform, tanimoto
> coeffcient (which is just intersection set divided by union set). Where do I
> write these distance metrics, amnd how do I tell Recommender to use this new
> metric?

Implementations of all these are available in the project already, so
you don't need to write them, but if you do want to write a new
implementation, you will implement UserSimilarity or ItemSimilarity,
just as the existing implementations do.

Look at the sample code, where it creates a UserSimilarity object. You
would simply substitute whatever implementation you like there.

View raw message