Skip to contents

Ranges from 0 (perfect equality) to nearly 1 (one unit holds everything). Applied to risk scores or stop counts, it measures how unequally a predictive system concentrates its attention. When group is supplied, per-group Gini values are also reported.

Ranges from 0 (perfect equality) to nearly 1 (one unit holds everything). Applied to risk scores or patrol counts it measures how unequally a system concentrates its attention. With group supplied, a per-group Gini is also reported.

Usage

morie_fairness_gini(values, group = NULL)

morie_fairness_gini(values, group = NULL)

Arguments

values

Vector of non-negative quantities.

group

Optional vector of protected-attribute values; enables the per-group breakdown.

Value

A morie_fairness_result; headline value is the overall Gini.

A named list: value (overall Gini), gini, per_group, warnings, interpretation.

Examples

morie_fairness_gini(c(5, 5, 5, 5))$value
#> [1] 0
morie_fairness_gini(c(0, 0, 0, 100))$value
#> [1] 0.75
morie_fairness_gini(c(5, 5, 5, 5))$value # 0
#> [1] 0
morie_fairness_gini(c(0, 0, 0, 100))$value # 0.75
#> [1] 0.75