# Module: tff.analytics.count_distinct

<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/federated/blob/v0.87.0 Version 2.0, January 2004 Licensed under the Apache License, Version 2.0 (the) |

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(...)`](https://www.tensorflow.org/federated/api_docs/python/tff/analytics/count_distinct/build_client_hyperloglog_computation): Builds a [`tff.Computation`](https://www.tensorflow.org/federated/api_docs/python/tff/Computation) for computing client hyperloglog sketches.

[`build_federated_secure_max_computation(...)`](https://www.tensorflow.org/federated/api_docs/python/tff/analytics/count_distinct/build_federated_secure_max_computation): Builds a [`tff.Computation`](https://www.tensorflow.org/federated/api_docs/python/tff/Computation) for computing max in a secure fashion.

[`create_federated_hyperloglog_computation(...)`](https://www.tensorflow.org/federated/api_docs/python/tff/analytics/count_distinct/create_federated_hyperloglog_computation): Creates a [`tff.Computation`](https://www.tensorflow.org/federated/api_docs/python/tff/Computation) to estimate the number of distinct strings.

<br />

<br />

<br />

| ## Other Members ||
|---|---|
| HLL_ALPHA | `0.697` |
| HLL_BIT_INDEX_HEAD | `5` |
| HLL_BIT_INDEX_TAIL | `27` |
| HLL_SKETCH_SIZE | `32` |

<br />