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

Some problems about Count Sketch #29

Open
ChickenWang00 opened this issue Aug 18, 2023 · 1 comment
Open

Some problems about Count Sketch #29

ChickenWang00 opened this issue Aug 18, 2023 · 1 comment

Comments

@ChickenWang00
Copy link

Dear Andrii,
I had a puzzle when I learn Count Sketch, for those small frequency data, if they collide with the high frequency data, and the hash is exactly 1 and -1, then the frequency estimate of the low frequency data will give a negative estimate, I want to ask how to deal with this situation, I read a lot of explanations did not mention this, thank you

@gakhov
Copy link
Owner

gakhov commented Sep 6, 2023

Sorry, didn't get the exact point where you get a negative estimate due to the collision to 1/-1. Maybe you can refer to it in the book?

However, since the frequency by definition cannot be negative, the most obvious way is to compute max(0, f_estimate) as the result.

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