compileml.viz

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#

NameTypeDefaultKind
decisiondictrequiredpositional
max_featuresint10keyword-only
labelsdict | NoneNonekeyword-only
colorsdict | NoneNonekeyword-only
ax—Nonekeyword-only
titlestr | NoneNonekeyword-only

Example#

python
from compileml.viz import waterfall
 
fig = waterfall(decision)

Worked example: waterfall →