Skip to main content

Ddm

Struct Ddm 

Source
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

Source

pub fn new() -> Self

Create a new DDM detector with default parameters.

Defaults: warning_level = 2.0, drift_level = 3.0, min_instances = 30.

Source

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 of min_s above min_p_plus_s to trigger a warning (typically 2.0).
  • drift_level – multiplier of min_s above min_p_plus_s to trigger drift (typically 3.0).
  • min_instances – number of observations required before the detector can emit Warning or Drift signals.
Source

pub fn warning_level(&self) -> f64

Return the current warning-level multiplier.

Source

pub fn drift_level(&self) -> f64

Return the current drift-level multiplier.

Source

pub fn min_instances(&self) -> u64

Return the minimum-instances warmup threshold.

Source

pub fn std_dev(&self) -> f64

Current population standard deviation of the observed stream.

Source

pub fn min_p_plus_s(&self) -> f64

Minimum mean + std observed so far.

Source§

impl Ddm

Source

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.

Source

pub fn reset(&mut self)

Reset to initial state.

Source

pub fn estimated_mean(&self) -> f64

Current estimated mean of the monitored stream.

Trait Implementations§

Source§

impl Clone for Ddm

Source§

fn clone(&self) -> Ddm

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Ddm

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Ddm

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for Ddm

Source§

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 Display for Ddm

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl DriftDetector for Ddm

Available on crate feature alloc only.
Source§

fn update(&mut self, value: f64) -> DriftSignal

Feed a new value and get the current drift signal.
Source§

fn reset(&mut self)

Reset to initial state.
Source§

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>

Clone this detector including its internal state. Read more
Source§

fn estimated_mean(&self) -> f64

Current estimated mean of the monitored stream.
Source§

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

Restore the detector’s internal state from a serialized snapshot. Read more
Source§

impl Serialize for Ddm

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. 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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,