public class CountMinSketch
extends java.lang.Object
Constructor and Description |
---|
CountMinSketch(int depth,
int width,
int seed) |
Modifier and Type | Method and Description |
---|---|
long |
addObjectAndEstimateCount(java.lang.Object item,
long count)
Similar to
add , however we reuse the fact that the hask buckets have to be calculated for add
already, and a separate estimateCount operation would have to calculate them again, so we do it all in one go. |
double |
confidence() |
long |
estimateCount(java.lang.Object item)
The estimate is correct within
'epsilon' * (total item count) ,
with probability confidence . |
double |
relativeError()
Referred to as
epsilon in the whitepaper |
long |
size() |
java.lang.String |
toString() |
public double relativeError()
epsilon
in the whitepaperpublic double confidence()
public long addObjectAndEstimateCount(java.lang.Object item, long count)
add
, however we reuse the fact that the hask buckets have to be calculated for add
already, and a separate estimateCount
operation would have to calculate them again, so we do it all in one go.public long size()
public long estimateCount(java.lang.Object item)
'epsilon' * (total item count)
,
with probability confidence
.public java.lang.String toString()
toString
in class java.lang.Object