calibration_by_group
def calibration_by_group(decisions, y, protected, *, labels=None, n_bins: int = 10) -> dict
from compileml.fairness import calibration_by_group
§4 — is the calibrated PD equally honest per group?
A model can pass every outcome test and still be systematically over-predicting risk for one group. That is its own finding, and it is invisible at the outcome layer.
Parameters#
| Name | Type | Default | Kind |
|---|---|---|---|
| decisions | — | required | positional |
| y | — | required | positional |
| protected | — | required | positional |
| labels | — | None | keyword-only |
| n_bins | int | 10 | keyword-only |
Returns#
dict