pub struct PoisoningPolicy {
pub outlier_threshold: Option<f32>,
}Expand description
Configuration for check_for_anomaly.
All knobs are opt-in: the default policy reproduces v0.3.2 behaviour
exactly (lexical markers + profile-based heuristics only). Callers
attach a policy to the engine via
crate::query::MnemoEngine::with_poisoning_policy.
§v0.3.3 additions
PoisoningPolicy::with_outlier_threshold enables the embedding-space
z-score outlier detector in crate::anomaly::outlier. When set, and
when a trained crate::model::embedding_baseline::EmbeddingBaseline
exists for the record’s agent, check_for_anomaly adds
OUTLIER_SCORE_CONTRIBUTION to the anomaly score whenever the record’s
embedding is at least threshold standard deviations from the baseline.
Fields§
§outlier_threshold: Option<f32>z-score threshold above which an embedding is considered an
outlier. None disables the check. Some(3.0) is a reasonable
starting point.
Implementations§
Source§impl PoisoningPolicy
impl PoisoningPolicy
Sourcepub fn with_outlier_threshold(self, threshold: f32) -> Self
pub fn with_outlier_threshold(self, threshold: f32) -> Self
Enable the z-score outlier gate with the supplied threshold.
Example: PoisoningPolicy::default().with_outlier_threshold(3.0)
Trait Implementations§
Source§impl Clone for PoisoningPolicy
impl Clone for PoisoningPolicy
Source§fn clone(&self) -> PoisoningPolicy
fn clone(&self) -> PoisoningPolicy
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for PoisoningPolicy
impl Debug for PoisoningPolicy
Source§impl Default for PoisoningPolicy
impl Default for PoisoningPolicy
Source§fn default() -> PoisoningPolicy
fn default() -> PoisoningPolicy
Auto Trait Implementations§
impl Freeze for PoisoningPolicy
impl RefUnwindSafe for PoisoningPolicy
impl Send for PoisoningPolicy
impl Sync for PoisoningPolicy
impl Unpin for PoisoningPolicy
impl UnsafeUnpin for PoisoningPolicy
impl UnwindSafe for PoisoningPolicy
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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