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

Fix issue with sampling without replacement #386

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

aristizabal95
Copy link

Before this fix uniform sampling is not guaranteed, over-representing the first combination of neighbors, and not sampling the last possible combination.

This PR ensures all neighbor combinations are considered during sampling, by extending the range of possible indices to include the last element.

Referencing to the example showcased in #385, using this change the sampling distribution is now:

(0, 1) 0.1707
(0, 2) 0.1643
(0, 3) 0.165
(1, 2) 0.1639
(1, 3) 0.1693
(2, 3) 0.1668

Closes #385.

Before this fix uniform sampling is not guaranteed, over-representing the first combination of neighbors, and not sampling the last possible combination

Co-authored-by: Jaime Mosquera Gutiérrez <Jaimemosg@users.noreply.github.com>
Co-authored-by: Andres Uriza <pa-uriza@users.noreply.github.com>
@codecov-commenter
Copy link

codecov-commenter commented Oct 1, 2024

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 73.09%. Comparing base (2d55981) to head (9d916ed).
Report is 4 commits behind head on master.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #386   +/-   ##
=======================================
  Coverage   73.09%   73.09%           
=======================================
  Files          29       29           
  Lines        1171     1171           
=======================================
  Hits          856      856           
  Misses        315      315           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.


🚨 Try these New Features:

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.

Neighbor Sampling without replacement doesn't sample uniformly
2 participants