OryxProject / oryx

Oryx 2: Lambda architecture on Apache Spark, Apache Kafka for real-time large scale machine learning

Home Page:http://oryx.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Recommend products FROM <IDs>

dataedgehungary opened this issue · comments

Hi Everyone.

I was wondering if it is possible or already implemented somehow, to set a list of ID from which all the recommendations are made? We work with a supermarket having 30.000 different items. Usually, 300 of them is on weekly sale. Ideally, I would like to list these IDs, and have Oryx recommend to users from only these 300.

Any help would be appreciated!

One approach is to ask for a very large number of recommendations and filter on the caller's side. That's pretty simple, but takes work to make and transfer all those recommendations, and you may not end up with many in the list of 300 (although, if none of the top recommendations are in that list, maybe you don't want to make a recommendation).

The more complex but performant way to do it is implement a RescorerProvider that returns a Rescorer that will filter out everything except those 300 from consideration. The implementation could have whatever business logic you like; Rescorers can receive arguments from the API request too, to control what they do. It's faster because it would only consider the subset of items you want. You'd include that implementation jar with your deployment and add it to the configuration file.