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

[FEATURE] Efficiency enhancement in surprise_utils.py #1222

Closed
zhaisw opened this issue Oct 27, 2020 · 3 comments
Closed

[FEATURE] Efficiency enhancement in surprise_utils.py #1222

zhaisw opened this issue Oct 27, 2020 · 3 comments
Labels
enhancement New feature or request

Comments

@zhaisw
Copy link
Contributor

zhaisw commented Oct 27, 2020

Description

In recommenders/reco_utils/recommender/surprise/surprise_utils.py compute_ranking_predictions function, the code will try to get unique items or users in every for-loop step, which will decrease the efficiency.

Expected behavior with the suggested feature

Better to use memory to improve code efficiency,

users = data[usercol].unique()
items = data[itemcol].unique()
for user in users:
        for item in items:
...

Other Comments

@zhaisw zhaisw added the enhancement New feature or request label Oct 27, 2020
@miguelgfierro
Copy link
Collaborator

this is really nice, do you want to do a PR?

@zhaisw
Copy link
Contributor Author

zhaisw commented Oct 29, 2020

this is really nice, do you want to do a PR?

Yes! For sure, I would like to do that. Thanks.

@miguelgfierro
Copy link
Collaborator

thanks for the contribution @zhaisw!
#1224

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants