CountMinSketch
Public Methods
| Return | Name | Description |
|---|---|---|
CountMinSketch | Construct a Count-Min sketch. | |
void | increment | Increment count for a key. |
uint64_t | estimate const | Estimate frequency of a key. |
void | clear | Reset all counters to zero. |
CountMinSketch
inline
Parameters
-
epsError parameter (epsilon). Error <= eps * N with probability delta Smaller eps = more memory, more accuracy -
deltaConfidence parameter. Error guarantee holds with probability (1 - delta) Smaller delta = more memory, higher confidence
Exceptions
-
std::invalid_argumentIf eps <= 0 or eps >= 1 -
std::invalid_argumentIf delta <= 0 or delta >= 1
Example:
increment
inline
Parameters
-
keyString identifier to count -
countAmount to add (default: 1)
estimate
const
Parameters
keyKey to estimate count for
Returns
Estimated count (guaranteed >= true count)Parameters
-
>=Actual frequency (upper bound) -
<=eps * N (theoretical upper bound)
clear
inline
Private Attributes
table_
w_
d_
Private Methods
| Return | Name | Description |
|---|---|---|
std::size_t | hash_fn const | Compute hash using double hashing technique. |
hash_fn
const