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
Implement random sample with replacement #173
Labels
Comments
Good idea! Random sampling with replacement, as far as I can tell, can be implemented as something like
Which is faster than an equivalent shuffle, since shuffles that sample the entire dataset would need to be O(n) wrt the dataset, whereas this can be O(n) or whatever, for the size of the sample. |
tmcw
added a commit
that referenced
this issue
Feb 17, 2017
Implements simple sampling with replacement, which, in contrast to the existing sample method, allows an item to be chosen more than once. Fixes #173
tmcw
added a commit
that referenced
this issue
Feb 17, 2017
Implements simple sampling with replacement, which, in contrast to the existing sample method, allows an item to be chosen more than once. Fixes #173
tmcw
added a commit
that referenced
this issue
Feb 17, 2017
Implements simple sampling with replacement, which, in contrast to the existing sample method, allows an item to be chosen more than once. Fixes #173
tmcw
added a commit
that referenced
this issue
Feb 17, 2017
Implements simple sampling with replacement, which, in contrast to the existing sample method, allows an item to be chosen more than once. Fixes #173
tmcw
added a commit
that referenced
this issue
Feb 17, 2017
Implements simple sampling with replacement, which, in contrast to the existing sample method, allows an item to be chosen more than once. Fixes #173
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Story: As a user I would like to draw random samples with replacement to generate bootstraps (or, in general, generate a series of independent random values from an array).
Suggested implementation: most natural would be adding an optional parameter to
shuffle
that allows to specify if the sample should be created with or without replacement.The text was updated successfully, but these errors were encountered: