representation
def representation(y, protected, *, labels=None, X=None, feature_names=None) -> dict
from compileml.fairness import representation
§1 — who is in the population, and what their observed rates are.
Also reports per-feature distribution divergence when X is given, so a
reviewer can see which *inputs* differ before asking why scores do. A
score gap explained entirely by an input gap is a different conversation
from one that is not.
Parameters#
| Name | Type | Default | Kind |
|---|---|---|---|
| y | — | required | positional |
| protected | — | required | positional |
| labels | — | None | keyword-only |
| X | — | None | keyword-only |
| feature_names | — | None | keyword-only |
Returns#
dict