The problem is the sparseness of your data. On average, each user made about 1.3 ratings. Few users even had 2, I'd imagine. So, it is hard to establish any similarity between any two users, because most users overlap in 0 or 1 items, and that means Pearson correlation is undefined.
(Using log-likelihood similarity would be slightly better, but probably not going to change this much.) When two users do have a similarity, it yields almost no candidate items to recommend since again users tend to barely rate more than the probably 2-3 items that make them similar. Code is OK; data is probably insufficient. The matrix-factorization-based approaches in the code base may do a lot better on super sparse data. For non-Hadoop-based jobs -- try SVDRecommender. It will certainly give an answer. (I'm working very directly on a matrix-factorization-based approach based on Mahout -- if something like SVDRecommender works for you then I do think you'd benefit from trying it at myrrix.com. It will do fine on sparse data like this where neighborhood-based technique have some trouble.) On Thu, Jun 14, 2012 at 10:47 PM, EDUARDO ANTONIO BUITRAGO ZAPATA < [email protected]> wrote: > Dear mahout community, > > I have been making some experiments with a dataset that I've scraped from > epinions.com (Electronics category). The dataset has the following > characteristics: > > # Users: 32098 > # Products: 8280 > # Reviews: 43139 > > Sparseness: 99.98% > > I trained a recommender using the example code shown in "mahout in action" > (bellow is the code). I want to recommend ALL items the user hasn't rated > yet because I want to know what would be the rating the user give for a > specific item (So that's why you see recommender.recommend(92833, 100)). I > made the following two experiments: > > 1. Using new NearestNUserNeighborhood (2,similarity, model); > But no recommendations are made > > 2. Using new NearestNUserNeighborhood (10,similarity, model); > But only one recommendation is made RecommendedItem[item:27515, > value:3.7595918] > > I would expect to have more recommendations, ¿am I doing something wrong? > ¿maybe is the sparseness of the matrix? I would appreciate any guidance. > Thanks for looking > > #####CODE##### > > public static void main(String[] args) throws Exception { > > DataModel model = new FileDataModel(new File(PATH_FILE)); > > RecommenderEvaluator evaluator = new > AverageAbsoluteDifferenceRecommenderEvaluator(); > > RecommenderBuilder recommenderBuilder = new RecommenderBuilder() { > @Override > public Recommender buildRecommender(DataModel model) > throws TasteException { > UserSimilarity similarity = new PearsonCorrelationSimilarity( > model); > UserNeighborhood neighborhood = new NearestNUserNeighborhood(10, > similarity, model); > return new GenericUserBasedRecommender(model, neighborhood, > similarity); > } > }; > > double score = evaluator.evaluate(recommenderBuilder, null, model, 0.8, > 1.0); > System.out.println(score); > > Recommender recommender = recommenderBuilder.buildRecommender(model); > > List<RecommendedItem> recommendations = recommender.recommend(92833, 100); > > for (RecommendedItem recommendation : recommendations) { > System.out.println(recommendation); > } > } > > -- > EDUARDO BUITRAGO >
