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

Add support for count parameter in TopK add method. #25

Merged
merged 4 commits into from
Jun 25, 2021

Conversation

jonahharris
Copy link
Contributor

I'm currently working on a project with semi-aggregated source data, which requires me to pass the precomputed frequency to the Top-K algorithm directly, rather than strictly on a one-at-a-time per-call-oriented basis. As TopK doesn't implement the CountingFilter interface, which I could see arguments for and against given its underlying algorithm is count-min-sketch, I avoided refactoring that and added a count parameter to its add method with a default value of one, similar to CountingFilter.update. Test case added accordingly. Thoughts?

@JustroX
Copy link
Contributor

JustroX commented Jun 23, 2021

+1. I also need this feature. Thank you jonahharris

@Callidon
Copy link
Owner

Hi, sorry for the response delay on this PR. Thanks for the addition, it's a neat idea! I'm merging it right away ;)

@Callidon Callidon merged commit df4b41f into Callidon:master Jun 25, 2021
@jonahharris
Copy link
Contributor Author

Thank you, @Callidon. This has been a really useful library. Thanks for writing and sharing it!

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