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

Unlock this course with a free trial

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

Evaluating collaborative filtering systems offline

Evaluating collaborative filtering systems offline - Python Tutorial

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

Evaluating collaborative filtering systems offline

- [Instructor] Now, although we can't measure accuracy with user-based or item-based collaborative filtering because they don't make rating predictions, we can still measure hit rate because it is still just a top-end recommender. So let's go back to spider have a look at our evaluateusercf.py file. This looks a lot like our simple usercf file but we set things up to do leave-one-out cross validation and we're using our recommender metrics package to measure hit rate on it. There's not a lot of new code to talk about here, we just generate the leave-one-out to test set up top here and use that when evaluating things at the end. And instead of just printing out the results, we store them so we can measure them, and we also generate up to 40 recommendations per user instead of 10. Also, we're generating recommendations for everyone, and not just a single test user. Let's run it out of curiosity. That was surprisingly fast, even though we're generating recommendations for everybody and…

Contents