pub struct ForensicBaseline<const D: usize> {
pub observed: [f64; D],
pub expected: [f64; D],
pub stddev: [f64; D],
pub delta: [f64; D],
pub zscore: [f64; D],
pub live_points: usize,
}Expand description
Per-dim forensic baseline comparing an observed point against the forest’s current live sample distribution.
Serialisable under the serde feature through the crate’s
fixed_array_f64 adapter — callers that persist alert records
for NIS2 / SOC2 audit trails can embed this struct directly.
Fields§
§observed: [f64; D]Raw query point the baseline was computed against.
expected: [f64; D]Per-dim mean of the live reservoir points (in raw space).
stddev: [f64; D]Per-dim population stddev of the live reservoir points.
delta: [f64; D]observed − expected per dim.
zscore: [f64; D]Per-dim z-score: delta / stddev, 0 when stddev is zero.
live_points: usizeNumber of unique live points contributing to the baseline.
Implementations§
Source§impl<const D: usize> ForensicBaseline<D>
impl<const D: usize> ForensicBaseline<D>
Sourcepub fn argmax_abs_zscore(&self) -> Option<usize>
pub fn argmax_abs_zscore(&self) -> Option<usize>
Index of the dimension with the largest |zscore| — the dim
most out-of-family relative to the live baseline. Returns
None on an empty forest (no live points) or when every
z-score is exactly zero.
Trait Implementations§
Source§impl<const D: usize> Clone for ForensicBaseline<D>
impl<const D: usize> Clone for ForensicBaseline<D>
Source§fn clone(&self) -> ForensicBaseline<D>
fn clone(&self) -> ForensicBaseline<D>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<const D: usize> Debug for ForensicBaseline<D>
impl<const D: usize> Debug for ForensicBaseline<D>
Source§impl<'de, const D: usize> Deserialize<'de> for ForensicBaseline<D>
impl<'de, const D: usize> Deserialize<'de> for ForensicBaseline<D>
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<const D: usize> PartialEq for ForensicBaseline<D>
impl<const D: usize> PartialEq for ForensicBaseline<D>
Source§impl<const D: usize> Serialize for ForensicBaseline<D>
impl<const D: usize> Serialize for ForensicBaseline<D>
impl<const D: usize> StructuralPartialEq for ForensicBaseline<D>
Auto Trait Implementations§
impl<const D: usize> Freeze for ForensicBaseline<D>
impl<const D: usize> RefUnwindSafe for ForensicBaseline<D>
impl<const D: usize> Send for ForensicBaseline<D>
impl<const D: usize> Sync for ForensicBaseline<D>
impl<const D: usize> Unpin for ForensicBaseline<D>
impl<const D: usize> UnsafeUnpin for ForensicBaseline<D>
impl<const D: usize> UnwindSafe for ForensicBaseline<D>
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