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

Maximum count of 4_294_967_295 on CountMinSketch #51

Closed
jonsnowseven opened this issue Jan 4, 2022 · 2 comments
Closed

Maximum count of 4_294_967_295 on CountMinSketch #51

jonsnowseven opened this issue Jan 4, 2022 · 2 comments

Comments

@jonsnowseven
Copy link

jonsnowseven commented Jan 4, 2022

Hello all.

https://github.com/RaRe-Technologies/bounter/blob/21aeda1b88402bacb44ce92d05c08b632a1edb21/cbounter/cms_conservative.c#L10

Is it possible to increase this type of make it configurable through Python? Otherwise, the following snippet won't work:

from bounter import CountMinSketch
cms = CountMinSketch(depth=19, width=2 ** 30)
cms.increment("some_value", 4_294_967_295)
cms.increment("some_value", 1_000)

cms["some_value"] # should be 4_294_967_295 + 1_000 but instead returns 4_294_967_295
@jponf
Copy link

jponf commented Nov 21, 2022

@jonsnowseven since my PR has been merged I believe this issue is now resolved.
Please confirm :)

@jonsnowseven
Copy link
Author

from bounter import CountMinSketch  # version 1.2.0
from bounter.count_min_sketch import CellSize
cms = CountMinSketch(depth=19, width=2 ** 30, cell_size = CellSize.BITS_64)
cms.increment("some_value", 4_294_967_295)
cms.increment("some_value", 1_000)

print("{:,}".format(cms["some_value"])) # prints 4,294,968,295

It worked!

Thanks @jponf 🤜🤛

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

3 participants