Building a User Based Collaborative Filtering Recommendation System in R

倖福魔咒の 提交于 2019-12-04 17:28:32

There are a couple of issues here: first, the predict() function will return the predicted rating for each item for the user you chose. If you want to recommend a Top N list, you'll have to predict the rating for every item for that user, then sort the ratings and return the top N.

Second, recommender systems normally use NULL or NA or missing data when a user and item have never interacted. You've used 0 for this. That means that the predictions are going to be heavily skewed toward 0 (given that most users don't interact with most items) and that your predictions are actually saying the probability that a user will even interact with an item. This may be a feature or a bug, depending on your use case. But if your ratings 1-10 represent preferences, and 0 represents a binary used/not used, then you're mixing information and you should replace 0 with NA.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!