Sitemap

AMAZON PERSONALIZE

3 min readOct 29, 2021

--

Getting started with Amazon Personalize, requires the creation of the Dataset Group and the association of up to three datasets. The only required dataset is the user-item interaction data.

At a minimum, the user-item interaction dataset requires the following three fields represented by the following names and datatypes:

· user_id(string)

· item_id(string)

· timestamp(long)

Additionally, you can choose to include the users and items datasets.

The users dataset is the first optional dataset and only requires the user_id field.

The items dataset is the second of two optional datasets and only requires the item_id field.

As an addition to the required fields, each of the datasets can include up to five metadata fields. Age and gender are examples of metadata fields that are used as part of the users dataset. Genre, color, and brand are examples of metadata fields that could be included in the items dataset.

To associate the datasets with the Dataset Group, a schema for each dataset must be created.

The schemas for Amazon Personalize conform to the Apache Avro format. When creating your schemas, you must comply with the following rules:

· The schema fields can be in any order, but they must match the order of the corresponding header columns in the dataset CSV file.

· All required fields for a specific dataset type must be included in the dataset and must conform to the datatype associated with the field.

· Metadata fields that are added in addition to the required fields can be a string or non-string type. If the metadata field is a string, it must also include the categorical attribute.

· Each schema and its related dataset can contain up to five metadata fields.

The following, taken from the official AWS Personalize documentation, is an example of a schema created for a users dataset:

{

“type”: “record”,

“name”: “Users”,

“namespace”: “com.amazonaws.personalize.schema”,

“fields”: [

{

“name”: “USER_ID”,

“type”: “string”

},

{

“name”: “AGE”,

“type”: “int”

},

{

“name”: “GENDER”,

Get AMIT JAIN’s stories in your inbox

Join Medium for free to get updates from this writer.

“type”: “string”,

“categorical”: true

}

],

“version”: “1.0”

}

The contents of a corresponding CSV file representing the users dataset should look similar to this example:

USER_ID,AGE,GENDER
john_doe,23,male
jane_doe,39,female
jeff_vader,62,male

After all of the datasets have been created and associated with schemas they can be imported into the Dataset Group.

Upon successful import, the process of creating a Solution can begin.

Solutions are the representation of trained ML models used to make recommendations to customers.

Amazon Personalize uses the concept of “recipes” to simplify the configuration and creation of personalized Solutions.

Each selectable recipe is represented by a different configured combination of algorithm and hyperparameters. Amazon Personalize provides three types of recipes, each with differing requirements.

Here is a list of the three recipe types and the individual recipes that fit into each of the three categories.

1. USER_PERSONALIZATION Recipes — predicts the items a user will interact with.

  1. HRNN
  2. HRNN-Metadata
  3. HRNN-Coldstart
  4. Popularity-Count
  5. PERSONALIZED_RANKING Recipes — personalizes ranked results.
  6. Personalized-Ranking
  7. RELATED_ITEMS Recipes — returns items similar to a given item.
  8. SIMS

The creation of the solution involves selecting the Create Solution option from the console, providing a name, choosing Automatic to allow AutoML to select the appropriate recipe, and then selecting whether to allow Amazon Personalize to perform Hyper Parameter Optimization (HPO).

Click “Next” to proceed and “Finish” on the next screen to confirm the configuration and create the Solution.

Once your Solution has been built, a solution version will need to be created to start the training process.

Select your Solution in the console and click on the “Create solution version” button in the top right of the screen.

As soon as the Solution version finishes training it is time to create a Campaign and start generating recommendations!

Testing your Campaign by generating a recommendation is as easy as going to the newly created Campaign in the console and entering a user_id in the User ID field found under the Test campaign results section.

Press enter or click to view image in full size

For more information, Kindly click here:

--

--