6

I am creating a recommendation engine using Amazon Personalize. I have to send it following data for it,

USER_ID,ITEM_ID,EVENT_TYPE,EVENT_VALUE,TIMESTAMP

I don't understand what EVENT_TYPE and EVENT_VALUE is in it.

1 Answers1

8

Short explanation

EVENT_TYPE, EVENT_VALUE is optional, if you are just starting with AWS Personalize, you can skip them for now.

EVENT_TYPE is event type of Interaction stored in dataset. Interaction is interaction of User with Item.

EVENT_VALUE is value of event of Interactions.

Maybe example will make it more understandable:

  • USER_ID - YouTube user ID
  • ITEM_ID - YouTube video
  • EVENT_TYPE - video_score, User liked or disliked the Video
  • EVENT_VALUE - 1 for like and -1 for dislike
  • TIMESTAMP - When did User watched the Video

Long explanation

Let's start from the beginning, in AWS Personalize you have 3 different types of datasets:

  1. Users
  2. Items
  3. Interactions

The content of datasets depends on your use case, for example, if you want to make video recommendations for user using Video sharing platform, then your datasets will probably contain data looking like this:

  1. Users: USER_ID, USER_NAME, USER_LAST_LOGIN [...] etc.
  2. Items: VIDEO_ID, VIDEO_CATEGORY, VIDEO_VIEWS [...] etc.
  3. Interactions: USER_ID,VIDEO_ID,EVENT_TYPE,EVENT_VALUE,TIMESTAMP

But to make it compatible with AWS Personalize, you should convert properties names to match Personalize requirements:

  1. Users: USER_ID, USER_NAME, USER_LAST_LOGIN [...] etc.
  2. Items: ITEM_ID, ITEM_CATEGORY, ITEM_VIEWS [...] etc.
  3. Interactions: USER_ID,ITEM_ID,EVENT_TYPE,EVENT_VALUE,TIMESTAMP

As you can see, Interactions datasets has the information about:

  1. Who (USER_ID) interacted with..
  2. ..what item (ITEM_ID)..
  3. ..at which time (TIMESTAMP).

Optionally you can add more information to this Interactions dataset, by providing EVENT_TYPE and EVENT_VALUE. So for example it would be like this:

  1. Who (USER_ID) interacted with..
  2. ..what item (ITEM_ID)..
  3. ..at which time (TIMESTAMP)..
  4. ..what type of interaction it was (EVENT_TYPE)..
  5. ..what was the value of interaction (EVENT_VALUE).

In service that serves Video content, EVENT_TYPE could be for example video_view and EVENT_VALUE would be value between 0.0 and 1.0, which will show how much of the Video did User watched. For example, 0.5 would be 50% of the Video.

The EVENT_TYPE and EVENT_VALUE is optional, so you don't have to provide them, however it doesn't affect quality of recommendations. The EVENT_VALUE is only used for configuration of Personalize (more about that later).

Also there is one case, that you should remember about. If you provide only EVENT_TYPE or EVENT_VALUE, AWS Personalize will give you an error, because you need both of them, or none of them (which makes sense, since there is no point in storing event data that has unknown value or type).

EVENT_TYPE doesn't have to be only video_view. It can also have different values, for example if user is going to like the video, your application will save this interaction like this:

EVENT_TYPE = 'like'
EVENT_VALUE = 1

For dislike could be:

EVENT_TYPE = 'like'
EVENT_VALUE = -1

The use of event value

In general, Personalize doesn't include event value during training of the model. It's simply ignored.

However you can use it for implementing your own logic. For example, you can provide Event value threshold during the Solution creation: Personalize Create Solution web console

This value threshold will be used to determine, if given interaction should be ignored, during Solution training. For example, if event value is percentage progress of watching a video, then having a threshold of 0.9 will make sure, than interactions included during the training, were about fully watching the video.

Also as you can see on the picture above, you can specify the event type itself, so the given solution will ignore all of the interactions, that doesn't match event type. It might be helpful in some cases.

Event type can be also used in Filters option, which was added a few months ago. It might be helpful to filter out the Items, that User already fully watched or bought, examples:

EXCLUDE itemId WHERE INTERACTIONS.event_type in ("fully_watched")

EXCLUDE itemId WHERE INTERACTIONS.event_type in ("purchased")
PatrykMilewski
  • 922
  • 8
  • 17
  • what's the event value for click? AWS Documentation is making it confusing. Is it 1 for click? USER_ID,ITEM_ID,EVENT_TYPE,EVENT_VALUE,TIMESTAMP 196,242,click,15,881250949 186,302,click,13,891717742 22,377,click,10,878887116 – Mudassar Hasnain Oct 02 '20 at 15:38
  • Hey, I just updated my answer, since it was a little bit outdated and had one mistake. It depends on your use case, because in general Personalize doesn't train models based on event value. The event value is used only for adjusting the Solution and Campaign for your use case. If you want to filter out some of click events during the training, then provide different values for different clicks, if not, then it can be always 1. – PatrykMilewski Oct 04 '20 at 11:31