Module: tff.analytics.count_distinct

Implementation of federated HyperLogLog for counting distinct items.

See https://en.wikipedia.org/wiki/HyperLogLog for additional details on this algorithm.

Functions

build_client_hyperloglog_computation(...): Builds a tff.Computation for computing client hyperloglog sketches.

build_federated_secure_max_computation(...): Builds a tff.Computation for computing max in a secure fashion.

create_federated_hyperloglog_computation(...): Creates a tff.Computation to estimate the number of distinct strings.

HLL_ALPHA 0.697
HLL_BIT_INDEX_HEAD 5
HLL_BIT_INDEX_TAIL 27
HLL_SKETCH_SIZE 32