API Reference

Organised by subpackage. Each symbol has its own page with a signature, parameters, return value, a minimal snippet, and links back to the source and to the normative section of the artifact spec where one applies.

Integrating with the JSON document rather than the Python API? Start with the artifact JSON schema.

compileml

Top level. Re-exports the three things a deployment needs.

compileml.datasets

The data the documentation compiles against. One real credit panel, fetched and cached; one synthetic generator that needs no network.

compileml.select

Choose the target, the tree count and the depth on data the reported figure never sees, then report once.

compileml.batch

Score a whole matrix through the artifact with NumPy, learning-side. The same integers the row-at-a-time runtime produces.

compileml.compile

Teacher model to integer model. Everything here runs at compile time and never ships to production.

compileml.artifact

Assemble the compiled model, calibration, bands and reasons into one hashed document.

compileml.bands

Build the risk ladder, and measure what the ladder discards.

compileml.reference

A weight-of-evidence logistic floor, so retention is read against a lower bound as well as a ceiling.

compileml.runtime

The deployment surface. Imports only the Python standard library, enforced by a test that parses every module's imports.

compileml.runtime — primitives

The integer primitives a conforming runtime must reproduce. Pair each with its normative section of the artifact spec when porting to another language.

ARTIFACT_TYPE
'compileml.decision_artifact'
SCHEMA_VERSION
2
PD_SCALE
1000000
LEAF
-2

compileml.scorecard

Collapse a depth ≤ 2 artifact into bin → points tables that re-derive any decision bit-for-bit.

compileml.tune

Measure the compilation choices instead of guessing them.

compileml.validate

Run the checks against the compiled artifact, through the same runtime production uses.

compileml.fairness

Audit compiled decisions by group: outcomes, predictive performance, and how the model behaves locally. Evidence for a validator, not a compliance certificate.

compileml.monitor

Read decisions after they were made: which features moved the score, whether the bands are still calibrated, whether the baseline still describes anyone.

compileml.export

Emit the decision as standalone SQL or COBOL, with no model runtime at all.

compileml.viz

Plots driven by the decision payload, so a chart cannot disagree with the deployed decision.