2

We are using SparkML's ALS implementation to give user-product recommendations. This is working great. We want to expand the recommendations to product-product similarity.

In other words given a products suggest similar products that users purchase. How can we expand MatrixFactorizationModel to get product-product similarity to get an API like List<Rating> getSimilarProducts(int productId)

All I could find is mahout's implementation of itemsimilarity which is like redoing the whole job again. Is there a way we can use ALS output to achieve the goal.

lazywiz
  • 1,091
  • 2
  • 13
  • 26
  • construct an user-item matrix and calculate similarities between columns using your preferred similarity measure. – mtoto Feb 08 '17 at 22:34
  • Thanks @mtoto, can you please give some more details as with the available APIs in MatrixFactorizationModel or ALS. – lazywiz Feb 08 '17 at 22:42
  • this is not available in the native implementation, you'll have to write this code yourself. check [here](https://www.packtpub.com/books/content/building-recommendation-engine-spark) for inspiration. – mtoto Feb 08 '17 at 22:50
  • Thanks, I checked it out. I think I get it now how to implement it. – lazywiz Feb 08 '17 at 23:34
  • I have answered you on Quora as the answer isn't fit for SO. Thus I'm voting to close this question as being broad. – eliasah Feb 09 '17 at 15:36
  • Can't say how to make ALS do this but the Universal Recommender based on the new Spark Mahout code does shopping cart, item-based, user-based, business rules, and can ingest all sorts of data that the ALS in MLlib cannot. It is still a major redo but there is an end-to-end implementation based on Apache PredictionIO here: https://github.com/actionml/universal-recommender. – pferrel Feb 09 '17 at 16:59

0 Answers0