pub struct GroupScores { /* private fields */ }Expand description
Decomposed anomaly score, one entry per FeatureGroup.
Implementations§
Source§impl GroupScores
impl GroupScores
Sourcepub fn new(scores: Vec<(String, f64)>, total: f64) -> Self
pub fn new(scores: Vec<(String, f64)>, total: f64) -> Self
Build from components. Normally produced by
crate::RandomCutForest::group_scores /
crate::ThresholdedForest::group_scores;
the constructor is public so tests and alternative backends
can synthesise instances too.
Sourcepub fn scores(&self) -> &[(String, f64)]
pub fn scores(&self) -> &[(String, f64)]
(group_name, contribution) pairs in declaration order.
Sourcepub fn total(&self) -> f64
pub fn total(&self) -> f64
Raw sum across all per-dim contributions (equal to
DiVector::total on the queried point, independent of
group coverage).
Sourcepub fn explained(&self) -> f64
pub fn explained(&self) -> f64
Sum of per-group contributions. When groups partition every
dimension with no overlap, this equals Self::total. With
gaps, explained < total; with overlap, explained >
total.
Sourcepub fn coverage(&self) -> f64
pub fn coverage(&self) -> f64
Ratio of Self::explained over Self::total, capturing
how much of the raw score is accounted for by the declared
groups. 1.0 for a partitioning coverage, < 1.0 for gaps,
> 1.0 for overlaps. Returns 0.0 when total is zero.
Trait Implementations§
Source§impl Clone for GroupScores
impl Clone for GroupScores
Source§fn clone(&self) -> GroupScores
fn clone(&self) -> GroupScores
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for GroupScores
impl Debug for GroupScores
Source§impl<'de> Deserialize<'de> for GroupScores
impl<'de> Deserialize<'de> for GroupScores
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 PartialEq for GroupScores
impl PartialEq for GroupScores
Source§impl Serialize for GroupScores
impl Serialize for GroupScores
impl StructuralPartialEq for GroupScores
Auto Trait Implementations§
impl Freeze for GroupScores
impl RefUnwindSafe for GroupScores
impl Send for GroupScores
impl Sync for GroupScores
impl Unpin for GroupScores
impl UnsafeUnpin for GroupScores
impl UnwindSafe for GroupScores
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