compileml

decide

def decide(artifact: dict, features: collections.abc.Sequence[float | None], *, top_k: int | None = None, explain: bool = True, include_contributions: bool = False) -> dict

from compileml import decide

Run the complete decision for one row and return the payload dict.

With explain=False this is the sub-millisecond score path: latent, band, and calibrated PD only. With explain=True it adds the exact integer attribution and reason blocks. Attribution is aggregated per tree, so its cost is O(trees) and independent of feature count.

Parameters#

NameTypeDefaultKind
artifactdictrequiredpositional
featurescollections.abc.Sequence[float | None]requiredpositional
top_kint | NoneNonekeyword-only
explainboolTruekeyword-only
include_contributionsboolFalsekeyword-only

Returns#

dict

Raises#

Read from the function body and the private helpers it calls, not inferred. A function that raises nothing has no section here.

Example#

python
from compileml.runtime import load_artifact, decide
 
artifact = load_artifact("decision.json")
decision = decide(artifact, row, explain=True)
print(decision["band"], decision["pd"], decision["latent_int"])

Worked example: decide →