How to solve the problem with product recommendations, for example: User __bought__ XXX also __viewed__ YYY

I'm currently studying a recommendation system, I learned something about collaborative filtering, User CF, Item CF, it’s obvious that using this algorithm to solve such problems as: 1) User bought XXX also bought YYY 2) User viewed by XXX, also looking at YYY

My question is: how to solve a problem like: 1) The user who bought XXX also viewed YYY 2) The user who viewed XXX also bought YYY?

Update: simply adjusted title: "User bought XXX also viewed YYY"

+4
source share
5 answers

While I'm not sure if this is really a “recommendation,” I can tell you how you approach domain recommendations in Mahout. You would build two DataModel s, one built on custom item purchases, and one built on custom item views. You must use the purchase data as input to implement the UserSimilarity or ItemSimilarity , but then feed the view data as input to the DataModel in the Recommender implementation. You would then calculate something more than what you offer.

+2
source

See the Taste Tab . For more alternatives, check out this post Recommended Engines for Java Applications

0
source

Say you have two product tables and sold_products. Each time you sell a product, it is added to the sold_products table. We will say that two tables are associated with product_id, order_id is used to group orders together in sold_products.

We will assume that the product you are looking at has a product_id of 1234.

  • Get a list of order_ids from the last 25 orders containing the product.

SELECT DISTINCT sold_products.order_id FROM sold_products WHERE product_id = 1234 LIMIT 25

  • From there we will put all the identifiers in a string separated by comers

eg. PO1234, PO435, PO3456 ....

  • Select product identifiers from these orders and I like to rank by frequency

SELECT DISTINCT Products. * FROM sold_products LEFT JOIN products at products.product_id = sold_products.product_id WHERE sold_products.order_id IN (PO1234, PO435, PO3456 ....) AND NOT sold_products.product_id = 1234 GROUP BY sold_products.product_id ORDER BY COUNT (1)

0
source

You need to send Chapter 2 of Collective Intelligence to OReilly . To find suitable products, i.e. Section "The customer who bought this product also bought ...", you need

  • first collect the preferences of different users.
  • Then find similar users
  • Then browse through the other items they purchased or liked.

There are algorithms involved in the above steps. More information is provided in this book along with python code for these algorithms.

0
source

You usually need two data sets. The transaction ID and product are both the first and visitorID, and the products are considered as the second to get% of the confidence that all two products are sold (or viewed) together. You can use R (statistical software) and install a package called "arules" to easily create these recommendations.

Here is an example of code you can check in R

setwd ("C: / Documents and Settings / rp / Desktop / output"); install.packages ("arules"); library ("arules"); txn = read.transactions (file = "Transactions_sample.csv", rm.duplicates = FALSE, format = "single", sep = ",", cols = c (1,2)); basket_rules <- apriori (txn, parameter = list (sup = 0.5, conf = 0.9, target = "rules")); check (basket_rules);

If you really want to understand how this works, you can check out the white document http://www.tatvic.com/resources , named as product analysis drawing analysis, which shows how you can do this simply using your web data.

In addition, if you want to use a ready-made API for it, it is available at http://www.liftsuggest.com/how-lift-product-recommendation-works

0
source

Source: https://habr.com/ru/post/1345652/


All Articles