Added count sketch#230
Merged
c-dickens merged 2 commits intoapache:count-sketch-pythonfrom Aug 12, 2021
Merged
Conversation
jmalkin
reviewed
Aug 9, 2021
|
|
||
| def is_empty(self): | ||
| """ | ||
| Returns True if the sketch self.table is empty and is False otherwise. |
Contributor
There was a problem hiding this comment.
There's a valid philosophical debate over whether adding and then subtracting an item means a sketch is truly empty. It might seem trivial with a single item, but imagine merging 2 sketches that were created with the same items but opposite weights -- if we treat it as empty, we lose the information that it has ingested data.
Certainly open to the idea that we don't care about a distinction, but it's worth thinking about what we want to capture by "empty"
jmalkin
approved these changes
Aug 9, 2021
Contributor
jmalkin
left a comment
There was a problem hiding this comment.
This is a reasonable start, but I think there's still a fair amount to do before it's production ready.
- there's no serialization, so it's not yet suitable for distributed use
- merge doesn't check for sketch compatibility, including matching table sizes. in order to be meaningful, I think we'd also want the hash functions to match?
- we really need to figure out a better hash function, as that seems important for ingesting arbitrary(-ish, in python) input types.
But I think this is sufficient to pull into a branch so we can start collaborative improvements
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Added a python implementation of count sketch for frequency estimation and heavy hitter detection.