Use case: itemset recommendations for shopping cart, wishlist, etc.
The model is created with (shopping-cart-id, purchase, item-id) This will create a (P'P) correlator matrix of items and items they were bought together. But since there is no user history involved, the current contents of the shopping cart would be used as the query. Same for any itemset type use case.
Item-based recommendations take a query of one item, we then lookup similar items and use this as the basis of the "should" part of the Elasticsearch model query.
This feature would take a JSON array of strings, all of which are item ids, which would substitute for the "should" part of the ES query. All other parts of the current query should be left intact.
The implementation involves changing the allowable queries to take:
"item": "item-id" or
"user": "user-id" or
"itemSet": ["item-1", "item2", ... "itemn"]
The items supplied in the "itemSet" array will be item-ids so they should be put in a form where they can be added to the rest of the query just as getBiasedSimilarItems creates a list from items stored in the model in Elasticsearch.
Note that just as "item" and "user" can be used together, an "itemSet" should also be added. This means that if only an "itemSet" is provided it will be a pure "shopping cart" type recommendation.
Use case: itemset recommendations for shopping cart, wishlist, etc.
The model is created with (shopping-cart-id, purchase, item-id) This will create a (P'P) correlator matrix of items and items they were bought together. But since there is no user history involved, the current contents of the shopping cart would be used as the query. Same for any itemset type use case.
Item-based recommendations take a query of one item, we then lookup similar items and use this as the basis of the "should" part of the Elasticsearch model query.
This feature would take a JSON array of strings, all of which are item ids, which would substitute for the "should" part of the ES query. All other parts of the current query should be left intact.
The implementation involves changing the allowable queries to take: "item": "item-id" or "user": "user-id" or "itemSet": ["item-1", "item2", ... "itemn"]
The current query options are defined here: https://github.com/actionml/template-scala-parallel-universal-recommendation/blob/master/src/main/scala/Engine.scala#L31
The part of the predict method where similar items to "item" above are found is here: https://github.com/actionml/template-scala-parallel-universal-recommendation/blob/master/src/main/scala/URAlgorithm.scala#L459
The items supplied in the "itemSet" array will be item-ids so they should be put in a form where they can be added to the rest of the query just as getBiasedSimilarItems creates a list from items stored in the model in Elasticsearch.
Note that just as "item" and "user" can be used together, an "itemSet" should also be added. This means that if only an "itemSet" is provided it will be a pure "shopping cart" type recommendation.