mahout-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gökhan Çapan <gkhn...@gmail.com>
Subject Re: Content-based Recommender Implementation
Date Tue, 22 Jun 2010 12:39:25 GMT
Sean, may the following approach be useful?
You can create item vectors whose dimensions are content attributes, and use
the framework as if you are implementing a recommender.

your data may be structured as
*item_id, content_feature_id*

instead of
*user_id, item_id*

and you can find similar items in terms of content features using a
Recommender

On Tue, Jun 22, 2010 at 3:11 PM, Sean Owen <srowen@gmail.com> wrote:

> This is the part that is more up to you, and outside the framework.
>
> Let's say you have movies as items. Let's say you want to use their
> genre and director (content, attributes) to define some idea of
> similarity. Maybe you make up the following rule:
>
> if genres are the same, add 0.1 to similarity
> if directors are the same, add 0.5 to similarity
>
> You could easily write code something like this to implement this
> notion of item-item similarity. (This is not a 100% complete example
> but shows most of what you need.)
>
> class MyItemSimilarity implements ItemSimilarity {
>  ...
>  public double itemSimilarity(long itemID1, long itemID2) {
>    MyMovie movie1 = lookupMyMovie(itemID1);
>    MyMovie movie2 = lookupMyMovie(itemID2);
>    double similarity = 0.0;
>    if (movie1.getGenre().equals(movie2.getGenre()) {
>      similarity += 0.1;
>    }
>    if (movie1.getDirector().equals(movie2.getDirector())) {
>      similarity += 0.5;
>    }
>    return similarity;
>  }
>  ...
> }
>
>
> And that's about it. You then use this ItemSimilarity instead of
> something like LogLikelihoodSimilarity or other implementations with a
> GenericItemBasedRecommender.
> There you go, this is as far as you have to go to do content-based
> recommendation in the framework.
>
> Because the hooks are pretty easy to use, and the logic above is so
> domain-specific, that's a pretty good "bright line" between CF and
> content-based recommendation that the framework itself doesn't cross.
>
> Well, this is at least one form of content-based recommendation.
>
>
>
>
>
> On Mon, Jun 21, 2010 at 2:08 PM, samsam <yanguango@gmail.com> wrote:
> > I know mahout have not supported content-based recommender,but I want to
> > recommend with item's specific attributes,so who can introduce the
> > implemention of content-based recommender? The book <mahout in action>
> > mentions that it can be implemented base on item-based recommender,but I
> > don't know how to do it specifically.
> >
> > And someone metioned that I should compute item-item similarities based
> on
> > their attributes first,and how to compute it?
> >
> > --
> > I'm samsam.
> >
>



-- 
Gökhan Çapan

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