-
Notifications
You must be signed in to change notification settings - Fork 149
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 recommend() function for the base class of Recommender #538
Conversation
is this a breaking change? :) |
It shouldn't initially, but now it seems to be :) Previously, our |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks fine to me
Please feel free to clone this branch and push changes. Sorry for many updates in this single PR, though if we break it down the models will not be working as expected. |
…rain_set shouldn't worry about users and items in validation and test
…_items in the future to be more explicit
Description
Adding
recommend()
to generate top-K item recommendations for a given user. Key difference between this function andrank()
function is thatrank()
works with mapped user/item index while this function works with original user/item ID. This helps hide the abstraction of ID-index mapping, and make model usage and deployment cleaner.In addition, we update the
uid_map
andiid_map
inDataset
object to point to the global ones. It requires some changes for previous usages in some models. Now,train_set
/val_set
/test_set
all hold references to the global mapping.BREAKING CHANGE: any model should be self-contained and be able to make prediction without
train_set
dependency. This will simplify model saving and deployment process. In order to make this possible, we update the models to hold certain attributes which were previously kept in thetrain_set
(e.g., num_users, num_items, uid_map, iid_map). Also, models should not hold reference totrain_set
/val_set
but only use them during training.After making the changes, I have tried to test all models to make sure they're runnable using the examples. However, I might miss certain details and would appreciate help from everyone to cross check, especially for the models that you've developed or you're familiar with.
Related Issues
Checklist:
README.md
(if you are adding a new model).examples/README.md
(if you are adding a new example).datasets/README.md
(if you are adding a new dataset).