O'Reilly logo

Building Recommendation Engines by Suresh Kumar Gorakala

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Item-based collaborative filtering

Item-based recommenders recommend similar items to users by considering the similarity between items instead of the similarity of users, as shown in the previous section.

The following is the given java program to build item-based collaborative filtering. We have used LogLikelihoodSimilarity to calculate ItemSimilarity, and then we used the GenericItemBasedRecommender class to recommend items to users. In addition, we can see how to check similar items for a given item using the mostSimilarItems method present in GenericItemBasedRecommender:

package com.packpub.mahout.recommendationengines; import java.io.File; import java.io.IOException; import java.util.List; import org.apache.mahout.cf.taste.common.TasteException; ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required