#[non_exhaustive]pub enum ThresholdMode {
ZSigma {
z_factor: f64,
},
Quantile {
p: f64,
},
}Expand description
Which statistic drives the adaptive threshold. Isolation-depth
scores are right-skewed and heavy-tailed (not Gaussian), so the
μ + z·σ form systematically over-flags during baseline calm
periods and under-flags during drift. ThresholdMode::Quantile
uses a streaming TDigest of the score distribution and thresholds
on the chosen tail percentile — closer to the caller’s actual
alert-rate budget (e.g. p = 0.99 ≈ 1 % firing rate).
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
ZSigma
Classic mean + z · stddev on the EMA of the score stream.
Back-compat default; keep this mode for Gaussian-like scores
(lag-embedded streams with symmetric noise).
Quantile
Streaming quantile threshold — threshold = TDigest.quantile(p)
of observed scores. Robust to the isolation-depth right-skew;
calibrates directly on the caller’s alert-rate budget. p
must be in (0, 1); typical values are 0.99 / 0.999.
Trait Implementations§
Source§impl Clone for ThresholdMode
impl Clone for ThresholdMode
Source§fn clone(&self) -> ThresholdMode
fn clone(&self) -> ThresholdMode
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ThresholdMode
impl Debug for ThresholdMode
Source§impl Default for ThresholdMode
impl Default for ThresholdMode
Source§impl<'de> Deserialize<'de> for ThresholdMode
impl<'de> Deserialize<'de> for ThresholdMode
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for ThresholdMode
impl PartialEq for ThresholdMode
Source§impl Serialize for ThresholdMode
impl Serialize for ThresholdMode
impl Copy for ThresholdMode
impl StructuralPartialEq for ThresholdMode
Auto Trait Implementations§
impl Freeze for ThresholdMode
impl RefUnwindSafe for ThresholdMode
impl Send for ThresholdMode
impl Sync for ThresholdMode
impl Unpin for ThresholdMode
impl UnsafeUnpin for ThresholdMode
impl UnwindSafe for ThresholdMode
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more