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

Return numpy arrays from recommend methods #482

Merged
merged 1 commit into from
Oct 9, 2021
Merged

Conversation

benfred
Copy link
Owner

@benfred benfred commented Oct 9, 2021

Change recommend/rank_items/similar_items/similar_users to return a numpy array of ids
and a numpy array of scores, rather than return a python list of (itemid, score) tuples.

This opens up options for batch processing in the future, and can be trivially converted
by users into the previous format (liked zip(*model.recommend(...)).

Change recommend/rank_items/similar_items/similar_users to return a numpy array of ids
and a numpy array of scores,  rather than return a python list of (itemid, score) tuples.

This opens up options for batch processing in the future, and can be trivially converted
by users into the previous format (liked ```zip(*model.recommend(...))```.
@benfred benfred merged commit dcfdc37 into api_refactor Oct 9, 2021
@benfred benfred deleted the ids_scores branch October 9, 2021 18:22
@benfred benfred mentioned this pull request Oct 9, 2021
6 tasks
@benfred benfred linked an issue Oct 9, 2021 that may be closed by this pull request
6 tasks
@benfred benfred removed a link to an issue Nov 26, 2021
6 tasks
benfred added a commit that referenced this pull request Dec 31, 2021
Change recommend/rank_items/similar_items/similar_users to return a numpy array of ids
and a numpy array of scores,  rather than return a python list of (itemid, score) tuples.

This opens up options for batch processing in the future, and can be trivially converted
by users into the previous format (liked ```zip(*model.recommend(...))```.
benfred added a commit that referenced this pull request Nov 21, 2022
#482 introduced a bug
where the output of the knn models wasn't strictly ordered by score.

Fix this and add a test that would have caught this bug
benfred added a commit that referenced this pull request Nov 21, 2022
#482 introduced a bug
where the output of the knn models wasn't strictly ordered by score.

Fix this and add a test that would have caught this bug
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.

1 participant