aif360.sklearn.metrics.generalized_entropy_index

aif360.sklearn.metrics.generalized_entropy_index(b, alpha=2)[source]

Generalized entropy index measures inequality over a population.

\[\begin{split}\mathcal{E}(\alpha) = \begin{cases} \frac{1}{n \alpha (\alpha-1)}\sum_{i=1}^n\left[\left(\frac{b_i}{\mu}\right)^\alpha - 1\right],& \alpha \ne 0, 1,\\ \frac{1}{n}\sum_{i=1}^n\frac{b_{i}}{\mu}\ln\frac{b_{i}}{\mu},& \alpha=1,\\ -\frac{1}{n}\sum_{i=1}^n\ln\frac{b_{i}}{\mu},& \alpha=0. \end{cases}\end{split}\]
Parameters:
  • b (array-like) – Parameter over which to calculate the entropy index.

  • alpha (scalar) – Parameter that regulates the weight given to distances between values at different parts of the distribution. A value of 0 is equivalent to the mean log deviation, 1 is the Theil index, and 2 is half the squared coefficient of variation.