Hi Sam, Item similarity in Mahout is based on co-occurances between items, e.g. 15 users have X'd items A & B and 7 users have X'd items A & C where X is some verb in your app (viewed, shared, rated, commented on ...). In my simplistic example, A&B are more similar than A&C since they occurred together more often. So, as Sean and Sebastian have said, you need this information before you can make recommendations using Mahout. This is the case with any new app that wants to use collaborative filtering but doesn't have a history of user-item interactions.
As Sebastian pointed out, you could start out by making recommendations strictly on content-based similarities (such as the output from a More Like This query in Lucene) and then introduce recommendations based on collaborative filtering as your user-item interaction data grows. Collaborative filtering in Mahout has several moving parts (item-based vs. user-based recommender, which similarity metric to use, optimal user neighborhood size for user-based recommenders, etc). To get "good" recommendations, you'll need to run Mahout's evaluation framework against your data so you can determine what are the best settings for your specific needs. Again, you need data to do this evaluation. Cheers, Tim On Sun, Sep 26, 2010 at 8:37 PM, Sam Yang <[email protected]> wrote: > And it's like this issue: > https://issues.apache.org/jira/browse/MAHOUT-367 > > On Mon, Sep 27, 2010 at 10:36 AM, Sam Yang <[email protected]> wrote: > > > But I got this when no preference data: > > ====== > > > > java.lang.IllegalArgumentException: size is less than 1 > > > > at > org.apache.mahout.cf.taste.impl.model.GenericItemPreferenceArray.<init>( > > GenericItemPreferenceArray.java:49) > > > > at > org.apache.mahout.cf.taste.impl.model.GenericItemPreferenceArray.<init>( > > GenericItemPreferenceArray.java:56) > > > > at > > > org.apache.mahout.cf.taste.impl.model.jdbc.AbstractJDBCDataModel.getPreferencesForItem( > > AbstractJDBCDataModel.java:441) > > > > at > > > org.apache.mahout.cf.taste.impl.recommender.GenericItemBasedRecommender.doMostSimilarItems( > > GenericItemBasedRecommender.java:169) > > > > at > > > org.apache.mahout.cf.taste.impl.recommender.GenericItemBasedRecommender.mostSimilarItems( > > GenericItemBasedRecommender.java:128) > > > > at > > > org.apache.mahout.cf.taste.impl.recommender.GenericItemBasedRecommender.mostSimilarItems( > > GenericItemBasedRecommender.java:121) > > > > at net.gamestreamer.recommendation.SimilarItemsFinder.find( > > SimilarItemsFinder.java:18) > > > > at > > > net.gamestreamer.recommendation.test.RecommenderTest.testSimilarItemsFinder( > > RecommenderTest.java:45) > > > > at net.gamestreamer.recommendation.test.RecommenderTest.main( > > RecommenderTest.java:85) > > > > ========= > > > > When create a preference data for the > item,GenericItemBasedRecommender.mostSimilarItems() > > works well. > > > > > > On Sun, Sep 26, 2010 at 9:49 PM, Sean Owen <[email protected]> wrote: > > > >> GenericItemBasedRecommender.mostSimilarItems() does not care. It just > >> uses your ItemSimilarity to do its work. > >> You'd have to be more specific to get more feedback. Are you sure your > >> ItemSimilarity is working, not returning NaN? > >> > >> On Sun, Sep 26, 2010 at 2:40 PM, Sam Yang <[email protected]> wrote: > >> > I have custom implementation of ItemSimilarity.Does > >> > GenericItemBasedRecommender.mostSimilarItems() > >> > need preference data? > >> > I new GenericItemBasedRecommender with the preference data model and > >> > implementation > >> > of ItemSimilarity,but seems mostSimilarItems() return no results. > >> > > > > > > > > -- > > I'm samsam. > > > > > > -- > I'm samsam. >
