pub struct Ddm { /* private fields */ }Expand description
DDM (Drift Detection Method) for concept drift detection.
Monitors running error rate and standard deviation. Signals warning when error exceeds minimum by 2 sigma, drift at 3 sigma.
Implementations§
Source§impl Ddm
impl Ddm
Sourcepub fn new() -> Self
pub fn new() -> Self
Create a new DDM detector with default parameters.
Defaults: warning_level = 2.0, drift_level = 3.0,
min_instances = 30.
Sourcepub fn with_params(
warning_level: f64,
drift_level: f64,
min_instances: u64,
) -> Self
pub fn with_params( warning_level: f64, drift_level: f64, min_instances: u64, ) -> Self
Create a DDM detector with custom parameters.
§Arguments
warning_level– multiplier ofmin_sabovemin_p_plus_sto trigger a warning (typically 2.0).drift_level– multiplier ofmin_sabovemin_p_plus_sto trigger drift (typically 3.0).min_instances– number of observations required before the detector can emit Warning or Drift signals.
Sourcepub fn warning_level(&self) -> f64
pub fn warning_level(&self) -> f64
Return the current warning-level multiplier.
Sourcepub fn drift_level(&self) -> f64
pub fn drift_level(&self) -> f64
Return the current drift-level multiplier.
Sourcepub fn min_instances(&self) -> u64
pub fn min_instances(&self) -> u64
Return the minimum-instances warmup threshold.
Sourcepub fn min_p_plus_s(&self) -> f64
pub fn min_p_plus_s(&self) -> f64
Minimum mean + std observed so far.
Source§impl Ddm
impl Ddm
Sourcepub fn update(&mut self, value: f64) -> DriftSignal
pub fn update(&mut self, value: f64) -> DriftSignal
Feed a new value and get the current drift signal.
This is the core algorithm, usable without the alloc feature.
When alloc is enabled, the DriftDetector::update trait method delegates here.
Sourcepub fn estimated_mean(&self) -> f64
pub fn estimated_mean(&self) -> f64
Current estimated mean of the monitored stream.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Ddm
impl<'de> Deserialize<'de> for Ddm
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>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl DriftDetector for Ddm
Available on crate feature alloc only.
impl DriftDetector for Ddm
Available on crate feature
alloc only.Source§fn update(&mut self, value: f64) -> DriftSignal
fn update(&mut self, value: f64) -> DriftSignal
Feed a new value and get the current drift signal.
Source§fn clone_fresh(&self) -> Box<dyn DriftDetector>
fn clone_fresh(&self) -> Box<dyn DriftDetector>
Create a fresh detector with the same configuration but no state.
Source§fn clone_boxed(&self) -> Box<dyn DriftDetector>
fn clone_boxed(&self) -> Box<dyn DriftDetector>
Clone this detector including its internal state. Read more
Source§fn estimated_mean(&self) -> f64
fn estimated_mean(&self) -> f64
Current estimated mean of the monitored stream.
Source§fn serialize_state(&self) -> Option<DriftDetectorState>
fn serialize_state(&self) -> Option<DriftDetectorState>
Serialize the detector’s internal state for model persistence. Read more
Source§fn restore_state(&mut self, state: &DriftDetectorState) -> bool
fn restore_state(&mut self, state: &DriftDetectorState) -> bool
Restore the detector’s internal state from a serialized snapshot. Read more
Auto Trait Implementations§
impl Freeze for Ddm
impl RefUnwindSafe for Ddm
impl Send for Ddm
impl Sync for Ddm
impl Unpin for Ddm
impl UnsafeUnpin for Ddm
impl UnwindSafe for Ddm
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
Mutably borrows from an owned value. Read more