pytyche.calibrate.artifact¶
Calibration artifact — the v0.2 minimal contract.
Consumed by posterior.apply_calibration(calibration). This module owns
only the minimal frozen shape: the layered correction payload plus the
regime metadata it was fitted on. The from_sweep(name_or_path)
registry constructor and the shipped artifacts are the calibration
track’s scope, NOT part of this module. There is no “skip” constructor:
the no-calibration choice is spelled None wherever a calibration is
accepted.
Classes
|
SBC-fitted calibration correction plus the regime it applies to. |
- class pytyche.calibrate.artifact.Calibration(correction, metric, n_treatments, pooling)[source]¶
Bases:
objectSBC-fitted calibration correction plus the regime it applies to.
Level: cross-cutting (sweep × experiment).
- correction¶
The layered R(p) + scale-family correction payload fitted on an SBC sweep.
- metric¶
Canonical metric name the sweep was fitted on (e.g.
"revenue_per_visitor").
- n_treatments¶
The K of the fitted sweep — variant count INCLUDING control.
- pooling¶
Pooling mode of the fitted sweep. NOT checked by
applies_to()(observed data carries no pooling);apply_calibrationchecks it against hurdle posteriors’poolingfield (binary/continuous have no pooling concept).
- Parameters:
correction (
LayeredCalibrationCorrection)metric (
str)n_treatments (
int)pooling (
Literal['joint','independent'])
- applies_to(observed)[source]¶
Whether this artifact’s fitted regime matches
observed.Trueiffobserved.metricequalsmetricandlen(observed.variants)equalsn_treatments.- Parameters:
observed (
ObservedExperimentData)- Return type:
bool