【问题标题】:Recombee batch does not send all the dataRecombee 批处理不发送所有数据
【发布时间】:2018-10-21 21:34:52
【问题描述】:

我正在使用 recombees API 进行推荐,并且有一个批处理方法可以将所有用户数据发送到 API。
以下代码:

for i in range(0,len(list_of_ratings)):
    name = str(list_of_ratings[i].user)
    series = str(list_of_ratings[i].series)
    rate = list_of_ratings[i].rating
    print(name + ' ' + series + ' ' + str(rate))
    request = AddRating(name, series, rate ,cascade_create=True)
    requests.append(request)

try:    
    client.send(Batch(requests))
except APIException as e:
    print(e) 
except ResponseException as e:
    print(e)
except ApiTimeoutException as e:
    print(e)
except Exception as e:
    print(e)

但问题是它没有发送所有数据。我在 Django 模型中有 946 个数据对象,但第一次运行时只发送了 20 个,第二次只发送了 6 个。
我不知道是什么导致了这个问题。
任何帮助表示赞赏。

【问题讨论】:

  • 您能否提供基于list_of_ratings 打印的示例输出?

标签: django recommendation-engine


【解决方案1】:

您的批次中可能有一些错误。我建议打印批处理结果以查看最终的错误消息:

res = client.send(Batch(requests))
print(res)

【讨论】:

    猜你喜欢
    • 2020-02-12
    • 2020-12-10
    • 1970-01-01
    • 2017-04-15
    • 1970-01-01
    • 2017-12-14
    • 1970-01-01
    • 2020-10-09
    • 1970-01-01
    相关资源
    最近更新 更多