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

Update pandas_df_utils.py #1297

Merged
merged 3 commits into from
Feb 10, 2021
Merged

Update pandas_df_utils.py #1297

merged 3 commits into from
Feb 10, 2021

Conversation

yueguoguo
Copy link
Collaborator

Fixed the issues of the negative sampler

Description

Fix the issue in the negative sampling function

Related Issues

N/A

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.

Fixed the issues of the negative sampler
Copy link
Collaborator

@anargyri anargyri left a comment

Choose a reason for hiding this comment

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

I think we can make negative sampling more efficient. Currently we create all user item pairs, which is time and memory consuming i.e. O(n_users x n_items). Instead, we could sample indexes in O(n_sample) time e.g. using numpy sampling functions.

@miguelgfierro
Copy link
Collaborator

miguelgfierro commented Feb 10, 2021

I think we can make negative sampling more efficient. Currently we create all user item pairs, which is time and memory consuming i.e. O(n_users x n_items). Instead, we could sample indexes in O(n_sample) time e.g. using numpy sampling functions.

+ 1 to using numpy

@miguelgfierro miguelgfierro merged commit a556ae6 into staging Feb 10, 2021
@miguelgfierro miguelgfierro deleted the yueguoguo-patch-1 branch February 10, 2021 21:34
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