【问题标题】:Building a recommender system using Surprise使用 Surprise 构建推荐系统
【发布时间】:2020-03-20 00:27:59
【问题描述】:

所以我正在使用这个名为 Surprise 的 python 库:https://surprise.readthedocs.io/en/stable/index.html

我遇到的问题是,当我遇到这个错误时,我的算法无法正确预测。 prints this saying the item doesnt exist.

但是,正如您在我的数据框中看到的那样,该项目确实存在: Dataframe

我按照文档正确加载数据使用:

 # The columns must correspond to user id, item id and ratings (in that order). 
 train_data = Dataset.load_from_df(games_data[['userid', 'name', 'metascore']], reader) 

文档建议我看看这个https://surprise.readthedocs.io/en/stable/FAQ.html#raw-inner-note,但我被它弄糊涂了。

我做错了什么?谢谢。

【问题讨论】:

  • 您的 raw_id 数字是包含在字符串中还是字母数字中?
  • 我的 raw_id 是一个字符串。

标签: python recommender-systems


【解决方案1】:

这有什么好运气吗?我也是这个包的新手,但我想知道是否可能由于数据类型问题而找不到用户。也许用户或项目需要强制匹配字符串或数字。

你能分享一下 games_data.info() 吗?

祝你好运!

【讨论】:

  • 您好,问题出在我的数据集上。每个用户需要有多个评分才能让算法认为“项目存在”。
猜你喜欢
  • 1970-01-01
  • 2013-12-26
  • 2010-12-03
  • 2022-11-25
  • 1970-01-01
  • 1970-01-01
  • 2010-11-17
  • 1970-01-01
  • 2014-06-10
相关资源
最近更新 更多