Coder Social home page Coder Social logo

movierecommendation's Issues

UserCF evaluate()

for i, user, in enumerate(self.trainSet): 是否应该是改成for i, user, in enumerate(self.testSet):

训练集、测试集划分方式

由于数据格式是
用户,电影,评分,时间
itemCF代码中划分测试集,训练集的方式
会让同一个用户的行为被分割到不同数据集中
可能影响整个过程,麻烦看一下

数据集有吗?

请问怎么联系你?有qq?可以把数据集发给我吗?谢谢

关于一些问题

你好!非常感谢你的代码。但是我认为你的代码中有一些错误。
第一,在recommend()函数中,rank[movie] += wuv这一句有问题,缺少用户对电影的评分。
第二,在计算指标时(以准确率为例),不能根据测试用户是否观看过所推荐的电影作为分子,造成指标偏低。

很好的协同过滤入门学习算法,但是有几个问题和错误

首先计算相似度并没有用用户-电影矩阵,而是用的用户共现矩阵,即看过相同电影的用户值为1,没有看过相同电影的用户值不是0而是根本不存在,这就导致evaluate()函数里如果for i, user in self.testSet.items(),会出现需要计算的用户在相似度矩阵里根本不存在的问题,会返回字典值错误 keyError,错误值就是想要计算却不存在的那个用户id。因此,在构建共现矩阵(co-rated matrix)的时候,如果u == v, 不应该直接continue,而是应该设为0值。

第二个问题就是这个协同过滤的计算准确率很低,用共现矩阵相当于根本没考虑电影的任何属性,只考虑了电影名,随便换个数据集就会出问题,我换了一个图书馆的图书数据集测试,推荐的准确率低的离谱。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.