pub struct ChangeFeedThresholds {
pub noise_ceiling: f64,
pub probable_floor: f64,
pub canary_weight: f64,
pub proxy_weight: f64,
pub extraction_weight: f64,
}Expand description
Configurable thresholds and source weights for
the ChangeDetector.
All fields default to the documented constants —
DEFAULT_NOISE_CEILING, DEFAULT_PROBABLE_FLOOR,
DEFAULT_CANARY_WEIGHT, DEFAULT_PROXY_WEIGHT,
and DEFAULT_EXTRACTION_WEIGHT. The struct is
Copy so it can live in a static configuration
without a wrapper.
§Example
use stygian_charon::change_feed::{
ChangeFeedThresholds, DEFAULT_CANARY_WEIGHT, DEFAULT_NOISE_CEILING,
DEFAULT_PROBABLE_FLOOR,
};
let thresholds = ChangeFeedThresholds::default();
assert!(thresholds.noise_ceiling > 0.0);
assert!(thresholds.probable_floor > thresholds.noise_ceiling);
let tightened = ChangeFeedThresholds::default()
.with_noise_ceiling(0.10)
.with_probable_floor(0.40);
assert!(tightened.noise_ceiling < 0.20);
assert!(tightened.probable_floor < 0.55);Fields§
§noise_ceiling: f64Upper edge of the Noise band (exclusive).
probable_floor: f64Lower edge of the Probable band (inclusive).
canary_weight: f64Source weight applied to canary-source deltas.
proxy_weight: f64Source weight applied to proxy-source deltas.
extraction_weight: f64Source weight applied to extraction-source deltas.
Implementations§
Source§impl ChangeFeedThresholds
impl ChangeFeedThresholds
Sourcepub fn with_noise_ceiling(self, ceiling: f64) -> Self
pub fn with_noise_ceiling(self, ceiling: f64) -> Self
Replace the noise_ceiling. Values < 0.0,
> 1.0, or NaN fall back to the documented
default so the classifier cannot silently
collapse the noise band.
Sourcepub fn with_probable_floor(self, floor: f64) -> Self
pub fn with_probable_floor(self, floor: f64) -> Self
Replace the probable_floor. Values < 0.0,
> 1.0, or NaN fall back to the documented
default. Values below noise_ceiling are
clamped up so the bands always retain a valid
ordering.
Sourcepub fn with_canary_weight(self, weight: f64) -> Self
pub fn with_canary_weight(self, weight: f64) -> Self
Replace the canary source weight. Non-finite or non-positive values fall back to the documented default.
Sourcepub fn with_proxy_weight(self, weight: f64) -> Self
pub fn with_proxy_weight(self, weight: f64) -> Self
Replace the proxy source weight. Non-finite or non-positive values fall back to the documented default.
Sourcepub fn with_extraction_weight(self, weight: f64) -> Self
pub fn with_extraction_weight(self, weight: f64) -> Self
Replace the extraction source weight. Non-finite or non-positive values fall back to the documented default.
Trait Implementations§
Source§impl Clone for ChangeFeedThresholds
impl Clone for ChangeFeedThresholds
Source§fn clone(&self) -> ChangeFeedThresholds
fn clone(&self) -> ChangeFeedThresholds
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more