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

Added tests for ranking function get_top_k_items() #1757

Merged
merged 6 commits into from
Jun 27, 2022

Conversation

ChuyangKe
Copy link
Contributor

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:

  • I have followed the contribution guidelines and code style for this project.
  • I have added tests covering my contributions.
  • I have updated the documentation accordingly.
  • This PR is being made to staging branch and not to main branch.

Copy link
Collaborator

@miguelgfierro miguelgfierro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some questions

@ChuyangKe ChuyangKe requested a review from miguelgfierro June 22, 2022 22:31
Copy link
Collaborator

@miguelgfierro miguelgfierro left a 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
Copy link
Collaborator

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

Copy link
Collaborator

@miguelgfierro miguelgfierro left a 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

@miguelgfierro miguelgfierro merged commit e83d90f into staging Jun 27, 2022
@miguelgfierro miguelgfierro deleted the chuyang/ranking-metrics branch June 27, 2022 07:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants