On Thu, Feb 11, 2010 at 11:53 AM, Jonathan Worthington
<[email protected]> wrote:
> 438356039,46305
> 438356039,46339
> 438386087,56304
> <another 1.5 million or so entries here>
>
> I then create a recommender like:
>
> DataModel Model = new FileDataModel(Path);

So far, perfect.

> ItemSimilarity SimilarityForItems = new PearsonCorrelationSimilarity(Model);

Here's the problem, and it's not obvious. Pearson only works when you
have ratings, and you don't. It'll end up being unable to compute any
similarities, so no results.

The fix is easy -- use LogLikelihoodSimilarity or
TanimotoCoefficientSimilarity, which are defined even without ratings.
I'd start with log-likelihood.

If you're interested in more on this, I'll shamelessly plug early
access to Mahout in Action. The parts available now include all of the
coverage of recommenders, including much on this issue.
http://www.manning.com/owen/


> ItemBasedRecommender Item = new GenericItemBasedRecommender(Model,
> SimilarityForItems);
>
> And then do:
>
> List<RecommendedItem> Recommended = Item.mostSimilarItems(ItemID, HowMany);

The rest is fine here. You can also compute recommendations of course,
instead of most similar items.

Reply via email to