Skip to contents

Quantile sketches

KLL, REQ, and t-Digest sketches for approximate quantiles, ranks, CDF, and PMF. t-Digest concentrates accuracy near the tails of the distribution.

kll_doubles()
KLL sketch for approximate quantiles of a numeric stream
kll_floats()
KLL sketch for approximate quantiles of a numeric stream stored as floats
req()
REQ sketch for relative-error approximate quantiles of a numeric stream
tdigest_double()
t-Digest sketch for approximate quantiles of a numeric stream

Cardinality sketches

HLL, CPC, and Theta sketches for approximate distinct counting. Theta sketches additionally support set operations.

hll()
HLL sketch for approximate distinct counting
cpc()
CPC sketch for approximate distinct counting
theta()
Theta sketch for approximate distinct counting and set operations
theta_union() theta_intersection() theta_difference() theta_jaccard()
Theta sketch set operations

Frequency sketches

Frequent Items and Count-Min sketches for approximate frequency estimation over a numeric or character stream.

frequent_items()
Frequent Items sketch for approximate frequency estimation
count_min()
Count-Min sketch for approximate point-frequency estimation
count_min_suggest_num_buckets() count_min_suggest_num_hashes()
Suggest Count-Min sketch parameters

Tuple sketches

Array of Doubles sketches, a Theta-extension that associates a fixed-size array of doubles with each retained key, for approximate distinct counting alongside per-column sums. Supports set operations.

array_of_doubles()
Array of Doubles (Tuple) sketch for estimating sums alongside distinct counts
array_of_doubles_union() array_of_doubles_intersection() array_of_doubles_difference()
Array of Doubles sketch set operations

Sampling sketches

VarOpt and EBPPS sketches sample weighted items from a stream: VarOpt for variance-optimal subset-sum estimation, and EBPPS as a modern alternative to reservoir sampling.

varopt()
VarOpt sketch for variance-optimal sampling and subset-sum estimation
varopt_union()
Combine two VarOpt sketches
ebpps()
EBPPS sketch for proportional-to-size sampling

Filters

Bloom filters for approximate set membership, sized up front by accuracy or by an explicit number of bits and hash functions.

bloom_filter()
Bloom filter for approximate set membership
bloom_filter_suggest_num_filter_bits() bloom_filter_suggest_num_hashes()
Suggest Bloom filter sizing parameters