waterfall
def waterfall(decision: dict, *, max_features: int = 10, labels: dict | None = None, colors: dict | None = None, ax=None, title: str | None = None)
from compileml.viz import waterfall
Single-decision waterfall: baseline → per-feature impacts → score.
The bars sum exactly to the decision (spec §7.4); what you see is the
audit, drawn. Requires a payload from
decide(..., include_contributions=True).
Returns: (figure, axes)
Parameters#
| Name | Type | Default | Kind |
|---|---|---|---|
| decision | dict | required | positional |
| max_features | int | 10 | keyword-only |
| labels | dict | None | None | keyword-only |
| colors | dict | None | None | keyword-only |
| ax | — | None | keyword-only |
| title | str | None | None | keyword-only |
Example#
python
from compileml.viz import waterfall fig = waterfall(decision)