From the course: Building Recommender Systems with Machine Learning and AI

Unlock this course with a free trial

Join today to access over 22,600 courses taught by industry experts.

User-based collaborative filtering: Hands-on

User-based collaborative filtering: Hands-on - Python Tutorial

From the course: Building Recommender Systems with Machine Learning and AI

User-based collaborative filtering: Hands-on

- [Instructor] So let's make all this talk concrete and run some real code to perform user-based collaborative filtering on the MovieLens dataset. Open up Spyder. (mouse clicks) And close out any old stuff we don't need anymore. Now open up the Collaborative Filtering folder in our course materials. And load up everything in there. The file we're interested in right now is SimpleUserCF.py. So click on that tab and let's walk through it. It's surprisingly small, right? Oh, see what I did there? Surprisingly. It's because we're using the Surprise library to do a lot of the heavy lifting here. So this script just walks through the steps we talked about in the slides. It's not really integrated into the evaluation framework we developed earlier because user-based collaborative filtering as we've described is strictly for generating top-end recommendations. At no point did we attempt to predict user ratings so we can't really shoehorn this algorithm into the Surprise framework because it…

Contents