pub struct EnhancedAnomalyLabel {
pub base: LabeledAnomaly,
pub category: AnomalyCategory,
pub enhanced_confidence: f64,
pub enhanced_severity: f64,
pub contributing_factors: Vec<ContributingFactor>,
pub secondary_categories: Vec<AnomalyCategory>,
}Expand description
Enhanced anomaly label with dynamic confidence and severity.
Fields§
§base: LabeledAnomalyBase labeled anomaly (backward compatible).
category: AnomalyCategoryEnhanced category classification.
enhanced_confidence: f64Dynamically calculated confidence (0.0 - 1.0).
enhanced_severity: f64Contextually calculated severity (0.0 - 1.0).
contributing_factors: Vec<ContributingFactor>Factors contributing to confidence/severity.
secondary_categories: Vec<AnomalyCategory>Secondary categories (for multi-label classification).
Implementations§
Source§impl EnhancedAnomalyLabel
impl EnhancedAnomalyLabel
Sourcepub fn from_base(base: LabeledAnomaly) -> Self
pub fn from_base(base: LabeledAnomaly) -> Self
Creates an enhanced label from a base labeled anomaly.
Sourcepub fn with_confidence(self, confidence: f64) -> Self
pub fn with_confidence(self, confidence: f64) -> Self
Sets the enhanced confidence.
Sourcepub fn with_severity(self, severity: f64) -> Self
pub fn with_severity(self, severity: f64) -> Self
Sets the enhanced severity.
Sourcepub fn with_factor(self, factor: ContributingFactor) -> Self
pub fn with_factor(self, factor: ContributingFactor) -> Self
Adds a contributing factor.
Sourcepub fn with_secondary_category(self, category: AnomalyCategory) -> Self
pub fn with_secondary_category(self, category: AnomalyCategory) -> Self
Adds a secondary category.
Sourcepub fn to_features(&self) -> Vec<f64>
pub fn to_features(&self) -> Vec<f64>
Converts to an extended feature vector.
Returns base features (15) + enhanced features (10) = 25 features.
Sourcepub fn feature_count() -> usize
pub fn feature_count() -> usize
Returns the number of features in the enhanced feature vector.
Sourcepub fn feature_names() -> Vec<&'static str>
pub fn feature_names() -> Vec<&'static str>
Returns feature names for the enhanced feature vector.
Trait Implementations§
Source§impl Clone for EnhancedAnomalyLabel
impl Clone for EnhancedAnomalyLabel
Source§fn clone(&self) -> EnhancedAnomalyLabel
fn clone(&self) -> EnhancedAnomalyLabel
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 EnhancedAnomalyLabel
impl Debug for EnhancedAnomalyLabel
Source§impl<'de> Deserialize<'de> for EnhancedAnomalyLabel
impl<'de> Deserialize<'de> for EnhancedAnomalyLabel
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 EnhancedAnomalyLabel
impl RefUnwindSafe for EnhancedAnomalyLabel
impl Send for EnhancedAnomalyLabel
impl Sync for EnhancedAnomalyLabel
impl Unpin for EnhancedAnomalyLabel
impl UnwindSafe for EnhancedAnomalyLabel
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