首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >协同学习模型的Fastai预测

协同学习模型的Fastai预测
EN

Stack Overflow用户
提问于 2021-03-28 06:49:21
回答 1查看 252关注 0票数 0

我有一个快速ai协同过滤模型。我想在这个模型上预测一个新的元组。我在使用预测功能时遇到了问题

从他们的文档来看,

代码语言:javascript
复制
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

我如何定义我需要传递的项。比方说,对于电影镜头数据集,对于已经在数据集中的用户,我们想推荐一组电影,我们如何通过userID?

我试着在这里跟上一个答案-- 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

EN

回答 1

Stack Overflow用户

发布于 2021-05-15 21:19:35

我认为这会有所帮助:

https://medium.com/@igorirailean/a-recommender-system-using-fastai-in-google-colab-110d363d422f

该文档还包含以下信息:

代码语言:javascript
复制
dl = learn.dls.test_dl(test_df)
learn.get_preds(dl=dl)

这对我有帮助。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/66836846

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档