Build a Recommender System in less than an hour using Amazon Personalize

Original article was published on Artificial Intelligence on Medium

Step 1: Data Preparation & Loading Data

Note: In order to paint a better picture — let us use an imaginary E-Commerce website for for all the 3 steps in which we are going to be using Amazon Personalize to build a Recommender System.

I had to prepare a CSV file with predefined columns with the “Who bought what?” data — this is called “Interactions”.

Example of columns required by Amazon Personalize

So we need: USER_ID and ITEM_ID, as well as TIMESTAMP (Unix Date format).

We need to dump our CSV file into an S3 bucket and for those who are new to AWS, S3 is an Object Storage. You can dump whatever you want into it but you’ll have to pay Jeff!

So without further ado — we launch Amazon Personalize!

Search for “Personalize” in the AWS Console to launch this service

In this first step, we’ll start by creating a dataset group in order to import our data into Amazon Personalize.

Create dataset group in Amazon Personalize

Then we will be redirected to the Overview Dashboard in the Amazon Personalize console. Make sure to click on Import User-Item interaction data. We will be importing our data from S3 into the Amazon Personalize dataset group simply by just pasting the path to the CSV file.

Upload datasets: User-item interaction data

To import our CSV, we must create a dataset name and also provide Amazon Personalize with a JSON schema. This JSON file is a schema definition and will be used to provide all required details before we start to build our Recommendation System.

Here’s how we can visualize the JSON schema file, hope it helps!

Schema definition (JSON) vs. CSV

Once this is done, we can click on “Start import” to import the CSV file in order to complete our process of creating a dataset — which wraps up Step 1!

Choose the S3 location of CSV data