Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add itemset recommendations to the UR #2

Open
pferrel opened this issue Jan 25, 2016 · 1 comment
Open

Add itemset recommendations to the UR #2

pferrel opened this issue Jan 25, 2016 · 1 comment
Assignees

Comments

@pferrel
Copy link

pferrel commented Jan 25, 2016

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.

@pferrel pferrel self-assigned this Jan 25, 2016
@pferrel
Copy link
Author

pferrel commented Jan 27, 2016

The new query that you will create is:
{
"itemSet": ["Iphone 4", “Galaxy"]
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant