Skip to main content

merge

Function merge 

pub fn merge(
    base: CalibrationArtifact,
    additional: CalibrationArtifact,
) -> CalibrationArtifact
Expand description

Blend two artifacts by sample-count-weighted interpolation of their quantile vectors, summing sample counts.

§Approximation

This is not an exact pooled re-quantiling. Exactness needs the two raw observation pools, which an artifact (breakpoints only) does not retain; the true pooled quantile of the union is generally not a weighted average of the per-corpus quantiles. For an exact merge, re-run calibrate over the union manifest instead. The weighted blend here is accurate when the two corpora have similar distributions and is a monotonic, order-preserving estimate otherwise — adequate for the --merge “fold my org’s repos into the world corpus” use case.

A (language, metric) present in only one input is carried through unchanged. A language present in only one input is carried through with its original sample count.