pub struct BocpdDetector {
config: BocpdConfig,
entity_id: u64,
ew_mean: Vec<f64>,
ew_var: Vec<f64>,
prev_mean: Vec<f32>,
count: usize,
since_last_detection: usize,
dim: Option<usize>,
}Expand description
Online streaming change point detector.
Fields§
§config: BocpdConfig§entity_id: u64§ew_mean: Vec<f64>Exponentially weighted mean per dimension.
ew_var: Vec<f64>Exponentially weighted variance per dimension.
prev_mean: Vec<f32>Previous mean (for drift vector computation).
count: usizeNumber of observations processed.
since_last_detection: usizeObservations since last detection (cooldown counter).
dim: Option<usize>Dimensionality.
Implementations§
Source§impl BocpdDetector
impl BocpdDetector
Sourcepub fn new(entity_id: u64, config: BocpdConfig) -> Self
pub fn new(entity_id: u64, config: BocpdConfig) -> Self
Create a new detector for the given entity.
Sourcepub fn observe(&mut self, timestamp: i64, vector: &[f32]) -> Option<ChangePoint>
pub fn observe(&mut self, timestamp: i64, vector: &[f32]) -> Option<ChangePoint>
Process a single observation.
Returns Some(ChangePoint) if a change is detected.
Sourcefn mahalanobis_like(&self, vector: &[f32]) -> f64
fn mahalanobis_like(&self, vector: &[f32]) -> f64
Compute a Mahalanobis-like distance (average z-score across dimensions).
Auto Trait Implementations§
impl Freeze for BocpdDetector
impl RefUnwindSafe for BocpdDetector
impl Send for BocpdDetector
impl Sync for BocpdDetector
impl Unpin for BocpdDetector
impl UnwindSafe for BocpdDetector
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