Recording events - Amazon Personalize
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

Recording events

With both domain recommenders and custom resources, Amazon Personalize can make recommendations based on real-time event data only, historical event data only, or a mixture of both.

Record real-time events to build out your interactions data and allow Amazon Personalize to learn from your user's most recent activity. This keeps your data fresh and improves the relevance of Amazon Personalize recommendations. If your domain use case or recipe supports real-time personalization, Amazon Personalize uses events in real time to update and adapt recommendations according to a user's evolving interest.

You can record real-time events using the Amazon SDKs, Amazon Amplify or Amazon Command Line Interface (Amazon CLI). When you record events, Amazon Personalize appends the event data to the Interactions dataset in your dataset group. If you record two events with exactly the same timestamp and identical properties, Amazon Personalize keeps only one of the events.

If you use Apache Kafka, you can use the Kafka connector for Amazon Personalize to stream data in real time to Amazon Personalize. For information see Kafka Connector for Amazon Personalize in the personalize-kafka-connector Github repository.

Amazon Amplify includes a JavaScript library for recording events from web client applications, and a library for recording events in server code. For more information, see Amplify - analytics.

Requirements for recording events and training a model

To record events, you need the following:

  • A dataset group that includes an Interactions dataset, which can be empty. If you went through the Getting started guide, you can use the same dataset group and dataset that you created. For information on creating a dataset group and a dataset, see Step 2: Preparing and importing data.

  • An event tracker.

  • A call to the PutEvents operation.

You can start out with an empty Interactions dataset and, when you have recorded enough data, train the model using only new recorded events. For all use cases (Domain dataset groups) and recipes (Custom dataset groups), your interactions data must have the following before training:

  • At minimum 1000 interactions records from users interacting with items in your catalog. These interactions can be from bulk imports, or streamed events, or both.

  • At minimum 25 unique user IDs with at least two interactions for each.

For quality recommendations, we recommend that you have at minimum 50,000 interactions from at least 1,000 users with two or more interactions each.

How real-time events influence recommendations

If your recipe supports real-time personalization, after you create a recommender or custom campaign, Amazon Personalize uses new recorded event data for existing items within seconds of import. The following use cases and recipes support real-time personalization:

If you use the Trending-Now recipe, Amazon Personalize automatically considers items from new events data over configurable intervals. You don't have to create a new solution version. For more information, see Trending-Now recipe.

If the item or user in the event is new, how the Amazon Personalize uses the data depends on your recipe. For more information, see How new data influences real-time recommendations.