-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Added tests for ranking function get_top_k_items() #1757
Conversation
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.
Some questions
Add comments Co-authored-by: Simon Zhao <[email protected]>
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.
Minor comments, looks great
assert(set(top_3_items_df[DEFAULT_ITEM_COL][6:]) == set([2, 5, 6])) | ||
# All itemIDs of user 3. All three items have a score of 5, so any order is OK. | ||
|
||
# Tests when k is larger than the number of available items |
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.
Minor comment, maybe it would help to clarify if you split this test into 2, one for just checking the normal functionality and another one for checking what happens when k is larger than the number of available items
Co-authored-by: Miguel González-Fierro <[email protected]>
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.
This is great Chuyang
Description
Added a unit test for get_top_k_items() to ensure correctness.
Related Issues
This is a follow-up PR of #1748. See #1748 (comment).
Checklist:
staging branch
and not tomain branch
.