You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
首先计算相似度并没有用用户-电影矩阵,而是用的用户共现矩阵,即看过相同电影的用户值为1,没有看过相同电影的用户值不是0而是根本不存在,这就导致evaluate()函数里如果for i, user in self.testSet.items(),会出现需要计算的用户在相似度矩阵里根本不存在的问题,会返回字典值错误 keyError,错误值就是想要计算却不存在的那个用户id。因此,在构建共现矩阵(co-rated matrix)的时候,如果u == v, 不应该直接continue,而是应该设为0值。
首先计算相似度并没有用用户-电影矩阵,而是用的用户共现矩阵,即看过相同电影的用户值为1,没有看过相同电影的用户值不是0而是根本不存在,这就导致evaluate()函数里如果for i, user in self.testSet.items(),会出现需要计算的用户在相似度矩阵里根本不存在的问题,会返回字典值错误 keyError,错误值就是想要计算却不存在的那个用户id。因此,在构建共现矩阵(co-rated matrix)的时候,如果u == v, 不应该直接continue,而是应该设为0值。
第二个问题就是这个协同过滤的计算准确率很低,用共现矩阵相当于根本没考虑电影的任何属性,只考虑了电影名,随便换个数据集就会出问题,我换了一个图书馆的图书数据集测试,推荐的准确率低的离谱。
The text was updated successfully, but these errors were encountered: