Skip to main content

ThresholdChecker

Struct ThresholdChecker 

Source
pub struct ThresholdChecker { /* private fields */ }
Expand description

Checker for threshold validation.

Implementations§

Source§

impl ThresholdChecker

Source

pub fn new(thresholds: EvaluationThresholds) -> Self

Create a new checker with the specified thresholds.

Source

pub fn check_min( &self, name: &str, actual: f64, threshold: f64, ) -> ThresholdResult

Check a single metric against a minimum threshold.

Source

pub fn check_max( &self, name: &str, actual: f64, threshold: f64, ) -> ThresholdResult

Check a single metric against a maximum threshold.

Source

pub fn check_range( &self, name: &str, actual: f64, min: f64, max: f64, ) -> ThresholdResult

Check a metric is within a range.

Source

pub fn check_statistical( &self, benford_p: Option<f64>, benford_mad: Option<f64>, temporal_corr: Option<f64>, ) -> Vec<ThresholdResult>

Check all statistical thresholds.

Source

pub fn check_coherence( &self, balance_imbalance: Option<f64>, subledger_rate: Option<f64>, doc_chain_rate: Option<f64>, ic_match_rate: Option<f64>, ) -> Vec<ThresholdResult>

Check all coherence thresholds.

Source

pub fn check_quality( &self, duplicate_rate: Option<f64>, completeness: Option<f64>, format_consistency: Option<f64>, ) -> Vec<ThresholdResult>

Check all quality thresholds.

Source

pub fn check_ml( &self, anomaly_rate: Option<f64>, label_coverage: Option<f64>, graph_connectivity: Option<f64>, ) -> Vec<ThresholdResult>

Check all ML thresholds.

Source

pub fn check_all( &self, benford_p: Option<f64>, benford_mad: Option<f64>, temporal_corr: Option<f64>, balance_imbalance: Option<f64>, subledger_rate: Option<f64>, doc_chain_rate: Option<f64>, ic_match_rate: Option<f64>, duplicate_rate: Option<f64>, completeness: Option<f64>, format_consistency: Option<f64>, anomaly_rate: Option<f64>, label_coverage: Option<f64>, graph_connectivity: Option<f64>, ) -> Vec<ThresholdResult>

Get all threshold results.

Source

pub fn all_pass(results: &[ThresholdResult]) -> bool

Check if all results pass.

Trait Implementations§

Source§

impl Default for ThresholdChecker

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

Source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Source§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
Source§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
Source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V