tabensemb.utils.utils.gini#
- tabensemb.utils.utils.gini(x: ndarray, w: ndarray | None = None) float[source]#
Calculate the gini index of a feature. https://stackoverflow.com/questions/48999542/more-efficient-weighted-gini-coefficient-in-python
- Parameters:
- x
The values of a feature.
- w
The weights of samples.
- Returns:
- float
The gini index of the feature.