Skip to content

Latest commit

 

History

History

retail_recommend

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

Recommendation for Retail Shop, or Content (Video, Music, News etc)

Business problem definition

Given some users and some items, and the history of each customer interacting each item, this solution should predict which user are likely to interact with which item.

Solution Diagram

System_Architecture

Basically, your sales website should be:

  • pushing customer purchase/click logs onto Alibaba cloud OSS
  • pulling the recommendation result from Maxcompute Data Service for rendering result.

I am following this official guide on PAI platform and created this solution.

Unfortunately, there is no data to reproduce the steps. So I downloaded from this link on UCI a similar dataset for easier reproduction. You download the sample by yourself, or get it from this repository at online_retail_200_rows.csv. In same folder, there is the larger original one.

List of cloud product used.

Prerequisite

You need to setup your own cridentials for run the samples.

Input Information

This solution requests 3 input information:

  • User List
  • Item List
  • Interaction history

Output Information

This solution produce a table with three columns:

  • User_id
  • Item_id
  • Similar_item_id

The result means for each user_id, you can recommend those products from "similar_item_id".

Steps

1. upload onto OSS

2. upload onto Load into Maxcompute storage

Follow the dataworks guide

3. Use dataworks+maxcompute to transform the data into PAI input format.

This is one sample SQL to transform original transaction into PAI Collaborative Filtering Format.

The SQL in dataworks look like sql_dataworks

git clone https://code.aliyun.com/best-practice/140.git 

4. Run PAI algorithm.

Create a project by PAI official tutorial. ![recommendation_tutorial] (./doc/pai_tutorial_20200401182152.jpg).

The PAI project should look like: System_pai

Wrap up all previous step into one business flow and run it every night.

Create a flow like this: dataworks_flow

(Optional) Serve your portal by data services

Please follow this DataService studio document to create data service API. Then in your portal, you can call this API to retrive information about a single user.

Future Roadmap

If you want to setup more advanced recommendation, check out this tutorial as well. The sample data is hosted here:

git clone https://code.aliyun.com/best-practice/140.git 

License

BSD Licensed.

Reference and Acknowledge Information

I am using a dataset from UCI for online retail sales. If you know more good content recommendation dataset, let me know, and we will make more approperiate version for advance content.

You may find original dataset from this link on UCI. I acknowledge and thank to provider by this reference:

    Daqing Chen, Sai Liang Sain, and Kun Guo, Data mining for the online retail industry: A case study of RFM model-based customer segmentation using data mining, Journal of Database Marketing and Customer Strategy Management, Vol. 19, No. 3, pp. 197–208, 2012 (Published online before print: 27 August 2012. doi: 10.1057/dbm.2012.17).