-
Notifications
You must be signed in to change notification settings - Fork 0
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
O(n)
worst case sampling runtime
#21
Comments
IIUC, the best this algorithm can get is |
yes my idea for this is to sort at some point after deleting/adding a certain number of elements e.g. now I'm using the really (too) simple https://github.com/Tortar/DynamicSampling.jl/blob/main/src/DynamicWeightedSampler.jl#L252, do you have suggestion for a better criterion? In general It would be cool to have some theoretical results on this I think |
Yes my earlier comment was wrong, you are right, it actually requires |
The worst case sample time is also
O(n)
(orO(1)
with a large constant factor, if you prefer to think about it that way), achieved when the list of levels starts with a lot of zeros:It's possible that this could be fixed by performing a partial sort while traversing the list during sampling, though maybe there's another way with less sampling overhead.
The text was updated successfully, but these errors were encountered: