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

Sample performance #250

Open
Yomguithereal opened this issue Oct 2, 2017 · 1 comment
Open

Sample performance #250

Yomguithereal opened this issue Oct 2, 2017 · 1 comment

Comments

@Yomguithereal
Copy link
Member

Currently, the sample function runs in O(k) (k being sample size) time but in O(n) (n being the size of the population). This can be awful for algorithms sampling large lists frequently (k-means, NN-descent etc...).

I developed some more efficients methods (having their drawback, however) in the pandemonium library (reservoir sampling still lacking but will soon be added). Does some of the library's method interest simple-statistics?

@tmcw
Copy link
Member

tmcw commented Oct 2, 2017

Absolutely! Simple-statistics doesn't have much flexibility in sampling: I started with the Fisher-Yates approach because I could be comfortable with it being suitably random. Would love to add other methods, especially ones that are similarly random-enough and ones that work with streaming data.

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

No branches or pull requests

2 participants