Search icon
Subscription
0
Cart icon
Close icon
You have no products in your basket yet
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Apache Mahout Essentials

You're reading from  Apache Mahout Essentials

Product type Book
Published in Jun 2015
Publisher
ISBN-13 9781783554997
Pages 164 pages
Edition 1st Edition
Languages
Author (1):
Jayani Withanawasam Jayani Withanawasam
Profile icon Jayani Withanawasam

Item-based recommenders


An item-based recommender measures the similarities between different items and picks the top k closest (in similarity) items to a given item in order to arrive at a rating prediction or recommendation for a given user for a given item.

For the movie recommendation scenario, an item-based recommender works as given in the following figure:

Let's say both Sunil and Roshan like the movies Interstellar (2014) and Star Wars (1977). Then, we can infer that Interstellar (2014) and Star Wars (1977) could be similar items. So, when Nimal likes Interstellar (2014), we recommend Star Wars (1977) to Nimal based on our previous observation.

The following is the Java code example for item-based recommenders:

DataModel model = new FileDataModel (new File("movie.csv"));

ItemSimilarity itemSimilarity = new EuclideanDistanceSimilarity (model);

Recommender itemRecommender = new GenericItemBasedRecommender(model,itemSimilarity);

List<RecommendedItem> itemRecommendations = itemRecommender...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}