The Recommendations API built with Microsoft Azure Machine Learning helps your customer discover items in your catalog. Customer activity in your digital store is used to recommend items and to improve conversion in your digital store.The recommendation engine may be trained by uploading data about past customer activity or by collecting data directly from your digital store. When the customer returns to your store you are able to feature recommended items from your catalog that may increase your conversion rate.
Frequently Bought Together (FBT) Recommendations
In this scenario, the recommendations engine recommends items that are likely to be purchased together in the same transaction with a particular item.
For instance, in the following example, customers who bought the Wedge Touch Mouse were also likely to buy at least one of the following products in the same transaction: Wedge Mobile Keyboard, the Surface VGA Adapter and Surface 2.
Item to Item Recommendations
A common scenario that uses this capability, is “people who visited/clicked on this item, also visited/clicked on this item.”
For instance, in the following example, most people who visited the “Wedge Touch Mouse” details page also visited the pages related to other mouse devices.
Customer to Item Recommendations
Given a customer’s prior activity, it is possible to recommend items that the customer may be interested in.
For instance, given all movies watched by a customer, it is possible to recommend additional content that may be of interest to the customer.
This document is a step-by-step guide. Our objective is to walk you through the steps necessary to train a model and to point you to resources that will allow you to consume the model from your production environment.
This exercise will take about 30 minutes.
To use Recommendations API, you need to take the following steps:
You will start building a Recommendations model. Then we’ll guide you on how to use the results generated by the model to power recommendations on an e-commerce site.
In this task, you’ll sign up for the Recommendations API service, and create a recommendations model.
The Recommendations API will learn from your catalog and your transactions in order to provide good product recommendations. That means you need to feed it with good data about your products (We call this a catalog file) and a set of transactions large enough for it to find interesting patterns of consumption (We call this usage).
Note
The sample code that you will download and run in Task 3 has sample data already embedded inside it — so this task is optional. That said, this Task will allow you to download more realistic data sets and allow you to understand the inputs into the Recommendations API better.
<itemid>,<item name>,<product category>
AAA-04294,OfficeLangPack 2013 32/64 E34 Online DwnLd,Office
AAA-04303,OfficeLangPack 2013 32/64 ET Online DwnLd,Office
C9F-00168,KRUSELL Kiruna Flip Cover for Nokia Lumia 635 – Camel,Accessories
We should point out that a catalog file can be much richer, for instance, you can add metadata about the products (We call these item features). You should see the catalog format section in the API Reference for more details on the catalog format.
<User Id>,<Item Id>,<Time Stamp>,<Event>
.00037FFEA61FCA16,288186200,2015/08/04T11:02:52,Purchase 0003BFFDD4C2148C,297833400,2015/08/04T11:02:50,Purchase 0003BFFDD4C2118D,297833300,2015/08/04T11:02:40,Purchase 00030000D16C4237,297833300,2015/08/04T11:02:37,Purchase 0003BFFDD4C20B63,297833400,2015/08/04T11:02:12,Purchase 00037FFEC8567FB8,297833400,2015/08/04T11:02:04,Purchase
Notice that the first three elements are mandatory. The event type is optional. You can check out the usage format for more information on this topic.
How much data do you need?
Well, it really depends on the usage data itself. The system learns when users buy different items. For some builds like FBT, it is important to know which items are purchased in the same transactions. (We call this co-occurrences). A good rule of thumb is to have most items be in 20 transactions or more, so if you had 10,000 items in your catalog, we would recommend that you have at least 20 times that number of transactions or about 200,000 transactions. Once again, this is a rule of thumb. You will need to experiment with your data.
Now that you have an account and you have data, let’s create your first model.
In this task, you will use the sample application to build your first model.
Learn more about build types and how to evaluate the quality of builds here.
Now that you understand how to create a model and consume recommendations, the next step is to put it in production on your website, mobile application or integrate into your CRM or ERP system. Obviously, each of these implementations would be different. Since the Recommendations API are requested as a web-service, you should be able to call it from any of these different environments easily.
Important
If you want to show recommendations from a public client (for instance, your e-commerce site), you should create a proxy server to provide the recommendations. This is important so that your API Key is not exposed to external (potentially untrusted) entities.
Here are a few ideas of locations where you can use Recommendations:
Item Recommendations
If the model was trained on purchase data, it will allow your customer to discover products that are likely to be of interest to people that have purchased the source item.
If the model was trained on click data, it will allow your customer to discover products that are likely to be visited by people that have visited the source item. This type of model may return similar items.
Frequently Bought Together Recommendations
A frequently bought together build could be trained, so you can get sets of items are likely to be purchased together with this item.
Item Recommendations
A recommendations model could take as input a list of items. So you could pass all the items in the basket as input to get recommendations. In this case, the model will provide recommendations that are of interest given all the items in the basket.
User Recommendations
A recommendations model can take as input the user id. This will use the history of transactions by that user to provide personalized recommendations to the user specified.
Check out the Get Item Recommendations Documentation.