pub struct AttributionStability { /* private fields */ }Expand description
Inter-tree dispersion of the attribution vector, paired with the mean.
Implementations§
Source§impl AttributionStability
impl AttributionStability
Sourcepub fn tree_count(&self) -> usize
pub fn tree_count(&self) -> usize
Number of trees that contributed an attribution.
Sourcepub fn coefficient_of_variation(&self, d: usize) -> f64
pub fn coefficient_of_variation(&self, d: usize) -> f64
Coefficient of variation for dim d — stddev[d] / |mean[d]|.
Returns 0.0 when |mean[d]| < f64::EPSILON (no dispersion is
observable when nothing was attributed).
§Panics
Panics when d >= self.dim() — callers size-check first.
Sourcepub fn confidence(&self, d: usize) -> f64
pub fn confidence(&self, d: usize) -> f64
Bounded [0, 1] confidence that dim d’s mean contribution
is a stable signal rather than a handful of trees agreeing by
chance. Derived as 1 / (1 + CV) — 1.0 for perfect
agreement, falling monotonically as CV rises.
§Panics
Panics when d >= self.dim() — callers size-check first.
Sourcepub fn argmax_mean(&self) -> Option<usize>
pub fn argmax_mean(&self) -> Option<usize>
Classic DiVector::argmax — dim with the largest mean
contribution, independent of stability. Returns None on an
empty attribution vector.
Sourcepub fn argmax_weighted(&self) -> Option<usize>
pub fn argmax_weighted(&self) -> Option<usize>
Dim maximising mean × confidence. Downranks dims where the
trees disagreed. Returns None on an empty attribution vector.
Trait Implementations§
Source§impl Clone for AttributionStability
impl Clone for AttributionStability
Source§fn clone(&self) -> AttributionStability
fn clone(&self) -> AttributionStability
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for AttributionStability
impl Debug for AttributionStability
Source§impl<'de> Deserialize<'de> for AttributionStability
impl<'de> Deserialize<'de> for AttributionStability
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>,
Auto Trait Implementations§
impl Freeze for AttributionStability
impl RefUnwindSafe for AttributionStability
impl Send for AttributionStability
impl Sync for AttributionStability
impl Unpin for AttributionStability
impl UnsafeUnpin for AttributionStability
impl UnwindSafe for AttributionStability
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