PredictionIO Universal Recommender

232 views Asked by At

I am quite new to predictionIO/universal recommender and wondering is there any way to model events between multiple entities like I want one event courseTaken between user and courses. O there I want is workingIn which will be between user and project. So far I haven't seen that this thing is possible in predictionIO. Can anyone please guide me in this regard?

1

There are 1 answers

0
kbt On

Coming from docs: When sending usage events it is required that the entityType is "user" and targetEntityType is "item". The type of the item is inferred from the event names, which must be one of the eventNames in the engine.json

Note that a usage event always is a user and has a user id. Also the "targetEntityType" is always "item". The actual target entity is implied by the event name. So to create a "category-preference" event you would send something like this:

{ "event" : "category-preference", "entityType" : "user", "entityId" : "1243617", "targetEntityType" : "item", "targetEntityId" : "electronics", "properties" : {}, "eventTime" : "2015-10-05T21:02:49.228Z" } To attach properties to items use a $set event like this:

{ "event" : "$set", "entityType" : "item", "entityId" : "ipad", "properties" : { "category": ["electronics", "mobile-phones"], "expireDate": "2016-10-05T21:02:49.228Z", "availableDate": "2015-10-05T21:02:49.228Z" }, "eventTime" : "2015-10-05T21:02:49.228Z" }

Based on above, secondary events are just like items, we need to do the following: 1. Add secondary events in configs, say ownProject 2. Add event with item id pointing to say the project, social, relation e.g.: { "event" : "own-Project", "entityType" : "user", "entityId" : "1243617", "targetEntityType" : "item", "targetEntityId" : "project-id", "properties" : {}, "eventTime" : "2015-10-05T21:02:49.228Z" }