skbio.diversity.alpha.
gini_index
(data, method='rectangles')[source]¶Calculate the Gini index.
State: Experimental as of 0.4.0.
The Gini index is defined as
where \(A\) is the area between \(y=x\) and the Lorenz curve and \(B\) is the area under the Lorenz curve. Simplifies to \(1-2B\) since \(A+B=0.5\).
Parameters: |
|
---|---|
Returns: | Gini index. |
Return type: | double |
Raises: |
|
Notes
The Gini index was introduced in [1]. The formula for
method='rectangles'
is
The formula for method='trapezoids'
is
References
[1] | Gini, C. (1912). “Variability and Mutability”, C. Cuppini, Bologna, 156 pages. Reprinted in Memorie di metodologica statistica (Ed. Pizetti E, Salvemini, T). Rome: Libreria Eredi Virgilio Veschi (1955). |