This topic describes how to use collaborative filtering to recommend products.
Background information
The correlation between diapers and beer is a classic example of data mining. Diapers and beer seem to be unrelated. However, when they are placed next to each other on shelves in supermarkets, the sales of both products significantly increase. You can use collaborative filtering, an algorithm that is commonly used in data mining, to explore the hidden correlations between different types of products. This way, the product sales can be boosted.
Collaborative filtering is based on association rules. For example, if both User 1 and User 2 purchased Products A and B, you can assume that User 1 and User 2 have similar interests in shopping. If User 1 purchases Product C but User 2 does not, you can recommend Product C to User 2. This is a typical example of user-based collaborative filtering, in which users are correlated based on their characteristics.
- The experiment only shows how to use collaborative filtering in a shopping scenario. Many key factors such as the time series are not included.
- The experiment considers only the correlations between products, but not the properties of the products, for example, whether a product is frequently purchased by the same user. For example, mobile phones are not frequently purchased by the same user. If a user buys a mobile phone in June, the user is unlikely to buy another mobile phone in July. The experiment does not consider the probability.
- We recommend that you use product recommendation based on collaborative filtering as an add-on to your service. To increase the accuracy of the prediction, we recommend that you use a model that is trained by using a machine learning algorithm.
Dataset
Field | Meaning | Data type | Description |
---|---|---|---|
user_id | User ID | STRING | The ID of the user. |
item_id | Item ID | STRING | The ID of the item. |
active_type | Shopping behavior | STRING |
|
active_date | Purchase date | STRING | The date on which the user purchased the item. |

Procedure
- Go to the Machine Learning Studio console.
- Log on to the PAI console.
- In the left-side navigation pane, choose .
- On the PAI Visualization Modeling page, find the project in which you want to create an experiment and click Machine Learning in the Operation column.
- Create an experiment.
- Run the experiment and view the result.
- In the top toolbar of the canvas, click Run.
- After the experiment is run, right-click Whole Table Statistics-1 on the canvas and select View Data. In the dialog box that appears, view the information about the generated recommendation list.
- Right-click Whole Table Statistics-2 on the canvas and select View Data. In the dialog box that appears, view the information about the recommendations that are hit.