pub struct ComparisonPolicy {
pub tolerance: DriftTolerance,
pub max_excluded_share: f64,
pub noise_floor: Option<NoiseFloor>,
}Expand description
Everything compare needs beyond the two reports.
use turnframe_eval::baseline::ComparisonPolicy;
// A tenth of the corpus may go unpaired before a headline is refused.
assert!((ComparisonPolicy::default().max_excluded_share - 0.1).abs() < 1e-9);Fields§
§tolerance: DriftToleranceHow much movement is noise rather than news.
The fraction of the paired corpus that may be excluded before the comparison refuses to produce a headline number.
A tenth by default, and deliberately low. The number exists because a report over a third of a corpus reads exactly like a report over all of it, and nothing in the shape of the output would ever tell a reader otherwise. Raise it only when you have looked at the exclusions and decided they are acceptable.
noise_floor: Option<NoiseFloor>What the same code produced against itself, when a control run measured it.
None leaves every change NoiseVerdict::Unmeasured: without a
control run there is no honest way to say whether a difference is signal.
Implementations§
Source§impl ComparisonPolicy
impl ComparisonPolicy
Sourcepub fn new(tolerance: DriftTolerance) -> Self
pub fn new(tolerance: DriftTolerance) -> Self
A policy with this tolerance and the default exclusion ceiling.
Sets how much of the paired corpus may be excluded before the headline is withheld.
Sourcepub fn with_noise_floor(self, floor: NoiseFloor) -> Self
pub fn with_noise_floor(self, floor: NoiseFloor) -> Self
Attaches the floor a control run measured.