build_scorecard
def build_scorecard(artifact: dict) -> dict
from compileml.scorecard import build_scorecard
Collapse a depth ≤ 2 artifact into an exact points scorecard.
Returns a dict with base_points_micro, per-feature main_effects
(interval → integer points), pairwise interactions (threshold grids
of integer points), and metadata. All points are in micro units — the
artifact's own integers — so they re-sum to raw_micro exactly.
Parameters#
| Name | Type | Default | Kind |
|---|---|---|---|
| artifact | dict | required | positional |
Returns#
dict
Raises#
- ValueError
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.scorecard import build_scorecard card = build_scorecard(artifact)