mixle.inference.create module¶
Certified model creation from data.
create fits a model through the ordinary Mixle inference machinery and
returns a CreatedModel artifact rather than a bare distribution. The
artifact contains the fitted model, an estimation certificate, optional
calibration, optional uncertainty quantification, and provenance.
The budget and device arguments are recorded as constraints and bias the
automatic structure search toward smaller, independence-first models. They do
not replace task-specific compression or edge-distillation workflows; they make
the creation boundary explicit when a caller already knows the deployment
envelope.
- class CreatedModel(model, certificate, strategy, calibration=None, uq=None, provenance=<factory>, postconditions=<factory>)[source]
Bases:
objectA certified model artifact: the fitted model plus its guarantees and provenance.
postconditionsrecords every post-fit condition the caller asked for and what became of it:{"calibration": {"requested": True, "performed": False, "error": "..."}, ...}. A requested postcondition that raised used to be replaced by a bareNonefield, so an artifact whose calibration and UQ had both failed was indistinguishable from one where neither was asked for – while still advertising the estimation certificate’s guarantee.- Parameters:
- failed_postconditions()[source]
Names of the postconditions the caller requested that did not complete.
- is_certified()[source]
Whether every requested postcondition actually completed.
The estimation certificate alone does not make an artifact certified: a caller who asked for calibration or UQ asked for it as part of the claim, so a silent failure invalidates the aggregate claim even though the fit itself succeeded.
- Return type:
- property guarantee: Any
The aggregate estimation guarantee (MIN over blocks) – the artifact’s summary claim.
Reports
Guarantee.UNVERIFIEDwhen a requested postcondition failed: the artifact cannot expose a guarantee stronger than the weakest condition it was asked to establish.
- is_calibrated()[source]
Whether the calibration holdout judged the model calibrated.
Nonemeans calibration was never requested. A requested calibration that failed isFalse, notNone– the check was asked for and did not pass, which is a different statement from never having asked.- Return type:
bool | None
- create(data, *, budget=None, device=None, calibrate=None, quantify_uq=False, max_its=25, seed=0)[source]
Create a certified model from
data(see module docstring).datais a list of records/scalars.calibrate(a fraction in (0,1)) reserves a holdout for a PIT calibration check.quantify_uq=Trueattaches an auto-selected UQ handle.budget/device(any object; recorded verbatim) constrain the fit toward a smaller model. Returns aCreatedModelbundling the fit, its certificate, and the requested post-conditions.