【发布时间】:2021-03-27 22:49:20
【问题描述】:
我有一个 Fast ai 协同过滤模型。我想在这个模型上预测一个新的元组。 我在使用预测功能时遇到问题
从他们的文档中,
Signature: learn.predict(item, rm_type_tfms=None, with_input=False)
Docstring: Prediction on `item`, fully decoded, loss function decoded and probabilities
File: ~/playground/virtualenv/lib/python3.8/site-packages/fastai/learner.py
Type: method
如何定义我需要传递的项目。假设对于一个movielens数据集,对于已经在数据集中的用户,我们想推荐一组电影,我们如何传递用户ID?
我在这里尝试了一些答案 - https://forums.fast.ai/t/making-predictions-with-collaborative-filtering/3900
learn.predict([np.array([3])])
我似乎收到了错误:TypeError: list indices must be integers or slices, not list
【问题讨论】:
标签: machine-learning pytorch fast-ai