# entropy

### cuml.metrics.cluster.entropy(clustering, base=None) → [float](https://docs.python.org/3/builtins/functions.html#float)[[source]](https://github.com/NVIDIA/cuml/blob/93418baf5/python/cuml/cuml/metrics/cluster/entropy.pyx#L25)

cython_entropy(clustering, base=None) -> float

Computes the entropy of a distribution for given probability values.

* **Parameters:**
  **clustering**
  : Clustering of labels. Probabilities are computed based on occurrences
    of labels. For instance, to represent a fair coin (2 equally possible
    outcomes), the clustering could be [0,1]. For a biased coin with 2/3
    probability for tail, the clustering could be [0, 0, 1].

  **base: float, optional**
  : The logarithmic base to use, defaults to e (natural logarithm).
* **Returns:**
  **S**
  : The calculated entropy.

<!-- !! processed by numpydoc !! -->
