mahout-recommenderbigdata

How to calculate similarity based on purchase records?


I have a purchase history data set. It contains userid, itemid, purchase records. The Purchase Records means how many times the user purchased the item.

dataset

So how can I calculate the user or item similarity based on this data set for producing recommendations.


Solution

  • You can go for Spark MLlib algorithms. Spark provides the Collaborative filtering - Alternating Least Squares (ALS) machine learning algorithm which gets trained using the user, products and rating. In your case rating will be the count(Number of times user purchased a item) of purchases for a item.

    You can straight away go for the ALS algorithm by following the example shown here Collaborative filtering - ALS.