FairnessAudit
from compileml.fairness import FairnessAudit
Three-layer fairness audit over compiled decisions.
Args:
decisions: decide() payloads, one per row. Pass
include_contributions=True when calling decide or §6 and
§8 cannot run.
y: Binary outcomes aligned with decisions.
protected: Protected attribute, aligned. Any hashable values.
labels: Optional {value: display_name}.
threshold_int: Cutoff in display-scale latent units; approved below
it. Defaults to the median score, which is a reporting
convenience and not a policy — set it to the cutoff you actually
use.
artifact: Needed for §7, §8 and §11, which re-read the compiled model.
X: Feature rows, needed for the same three sections.
protected_feature: Name of the protected attribute *if it is a model
input*. Leave None only when it is not. §11 cannot tell the
difference from None alone, so it reports that no input was
named and does not run — which is not evidence the model ignores
the attribute.
Fields#
| Name | Type | Default | Kind |
|---|---|---|---|
| decisions | — | required | positional |
| y | — | required | positional |
| protected | — | required | positional |
| labels | — | None | keyword-only |
| threshold_int | int | None | None | keyword-only |
| artifact | dict | None | None | keyword-only |
| X | — | None | keyword-only |
| protected_feature | str | None | None | keyword-only |
Methods#
- compute_all()
- print_summary()
- section()
- summary()
Raises#
- KeyError
- RuntimeError
- ValueError
Read from the function body and the private helpers it calls, not inferred. A function that raises nothing has no section here.