我正在尝试使用AWS Personalize。创建数据集和批处理推断后,我将使用personalize.putEvents(使用Javascript SDK,docs)更新user-item-interactions
片段:
const awsOpts = { apiVersion, accessKeyId, secretAccessKey, region } const pEvents = new AWS.PersonalizeEvents(awsOpts) // ... const params = { trackingId, userId, sessionId, eventList: [{ eventId: (+sentAt) + "", sentAt, eventType, properties: { itemId } }] } pEvents.putEvents(params, (err, data) => err ? reject(err) : resolve(data))
该事件似乎已注册。没有错误。之后,当我创建另一个批处理推断时,我希望新的用户项目不再出现在建议中。但是,下一个批处理推断中的建议未更改。我做错了什么还是我误解了putEvents-API调用?
参考架构:
{ "type": "record", "name": "Interactions", "namespace": "com.amazonaws.personalize.schema", "fields": [ { "name": "USER_ID", "type": "string" }, { "name": "ITEM_ID", "type": "string" }, { "name": "EVENT_TYPE", "type": "string" }, { "name": "TIMESTAMP", "type": "long" } ], "version": "1.0" }
一件事情似乎有些奇怪:Cloud watch报告lambda已执行两次,尽管没有错误也没有超时(timeout设置为10s,并且lambda花费的时间少于2s)。也Retry attempts设置为2。