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

Calibration(correction, metric, ...)

SBC-fitted calibration correction plus the regime it applies to.

class pytyche.calibrate.artifact.Calibration(correction, metric, n_treatments, pooling)[source]

Bases: object

SBC-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_calibration checks it against hurdle posteriors’ pooling field (binary/continuous have no pooling concept).

Parameters:
applies_to(observed)[source]

Whether this artifact’s fitted regime matches observed.

True iff observed.metric equals metric and len(observed.variants) equals n_treatments.

Parameters:

observed (ObservedExperimentData)

Return type:

bool