pub struct ContributingFactor {
pub factor_type: FactorType,
pub value: f64,
pub threshold: f64,
pub direction_greater: bool,
pub weight: f64,
pub description: String,
pub evidence: Option<FactorEvidence>,
}Expand description
A contributing factor to anomaly confidence/severity.
Fields§
§factor_type: FactorTypeType of factor.
value: f64Observed value.
threshold: f64Threshold or expected value.
direction_greater: boolDirection of comparison (true = value > threshold is anomalous).
weight: f64Weight of this factor in overall calculation (0.0 - 1.0).
description: StringHuman-readable description.
evidence: Option<FactorEvidence>Optional supporting evidence.
Implementations§
Source§impl ContributingFactor
impl ContributingFactor
Sourcepub fn new(
factor_type: FactorType,
value: f64,
threshold: f64,
direction_greater: bool,
weight: f64,
description: &str,
) -> Self
pub fn new( factor_type: FactorType, value: f64, threshold: f64, direction_greater: bool, weight: f64, description: &str, ) -> Self
Creates a new contributing factor.
Sourcepub fn with_evidence(self, source: &str, data: HashMap<String, String>) -> Self
pub fn with_evidence(self, source: &str, data: HashMap<String, String>) -> Self
Adds evidence to the factor.
Sourcepub fn contribution(&self) -> f64
pub fn contribution(&self) -> f64
Calculates the factor’s contribution to anomaly score.
Trait Implementations§
Source§impl Clone for ContributingFactor
impl Clone for ContributingFactor
Source§fn clone(&self) -> ContributingFactor
fn clone(&self) -> ContributingFactor
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ContributingFactor
impl Debug for ContributingFactor
Source§impl<'de> Deserialize<'de> for ContributingFactor
impl<'de> Deserialize<'de> for ContributingFactor
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
Auto Trait Implementations§
impl Freeze for ContributingFactor
impl RefUnwindSafe for ContributingFactor
impl Send for ContributingFactor
impl Sync for ContributingFactor
impl Unpin for ContributingFactor
impl UnwindSafe for ContributingFactor
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