From the course: Building Recommender Systems with Machine Learning and AI
Unlock this course with a free trial
Join today to access over 22,700 courses taught by industry experts.
Item-based collaborative filtering: Hands-on - Python Tutorial
From the course: Building Recommender Systems with Machine Learning and AI
Item-based collaborative filtering: Hands-on
- [Instructor] So let's play around with item-based collaborative filtering. Open Spyder back up and take a look at SimpleItemCF.py. As you might expect, it looks a lot like SimpleUserCF.py, because the general approach is the same as user-based collaborative filtering. We're just focusing on relationships between items instead of users. The first difference you'll see is that, when we set up these sim options, we're passing false for user-based. This tells the surprise library to generate an item-to-item similarity matrix using cosine as its similarity metric instead of a user-to-user similarity matrix. Next, we pull off the top K highest-rated items for our test user, then we look up all of the items similar to each of those items. These become our recommendation candidates, and as we build up our list of candidates, we score them by their similarity score to the item our user rated and by the rating our user gave that item. The rest of the code is the same. We build up a dictionary…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
-
(Locked)
Measuring similarity and sparsity4m 49s
-
(Locked)
Similarity metrics8m 32s
-
User-based collaborative filtering7m 25s
-
(Locked)
User-based collaborative filtering: Hands-on4m 59s
-
(Locked)
Item-based collaborative filtering4m 14s
-
(Locked)
Item-based collaborative filtering: Hands-on2m 23s
-
(Locked)
Tuning collaborative filtering algorithms3m 31s
-
(Locked)
Evaluating collaborative filtering systems offline1m 28s
-
(Locked)
Measure the hit rate of item-based collaborative filtering2m 17s
-
(Locked)
KNN recommenders4m 4s
-
(Locked)
Running user- and item-based KNN on MovieLens2m 26s
-
(Locked)
Experiment with different KNN parameters4m 25s
-
(Locked)
Bleeding edge alert: Translation-based recommendations2m 29s
-
(Locked)
-
-
-
-
-
-
-
-