pub struct NearMissGenerator { /* private fields */ }Expand description
Generator for near-miss patterns.
Implementations§
Source§impl NearMissGenerator
impl NearMissGenerator
Sourcepub fn new(config: NearMissConfig) -> Self
pub fn new(config: NearMissConfig) -> Self
Creates a new near-miss generator.
Sourcepub fn record_transaction(
&mut self,
document_id: impl Into<String>,
date: NaiveDate,
amount: Decimal,
account: impl Into<String>,
counterparty: Option<String>,
)
pub fn record_transaction( &mut self, document_id: impl Into<String>, date: NaiveDate, amount: Decimal, account: impl Into<String>, counterparty: Option<String>, )
Records a transaction for near-duplicate tracking.
Sourcepub fn check_near_miss(
&mut self,
document_id: impl Into<String>,
date: NaiveDate,
amount: Decimal,
account: impl Into<String>,
counterparty: Option<String>,
thresholds: &[Decimal],
) -> Option<NearMissLabel>
pub fn check_near_miss( &mut self, document_id: impl Into<String>, date: NaiveDate, amount: Decimal, account: impl Into<String>, counterparty: Option<String>, thresholds: &[Decimal], ) -> Option<NearMissLabel>
Checks if a transaction should be marked as a near-miss.
Sourcepub fn create_corrected_error(
&mut self,
document_id: impl Into<String>,
original_error_id: impl Into<String>,
correction_lag_days: u32,
) -> NearMissLabel
pub fn create_corrected_error( &mut self, document_id: impl Into<String>, original_error_id: impl Into<String>, correction_lag_days: u32, ) -> NearMissLabel
Creates a corrected error near-miss.
Sourcepub fn get_labels(&self) -> &[NearMissLabel]
pub fn get_labels(&self) -> &[NearMissLabel]
Returns all generated labels.
Sourcepub fn get_statistics(&self) -> NearMissStatistics
pub fn get_statistics(&self) -> NearMissStatistics
Returns statistics about generated near-misses.
Auto Trait Implementations§
impl Freeze for NearMissGenerator
impl RefUnwindSafe for NearMissGenerator
impl Send for NearMissGenerator
impl Sync for NearMissGenerator
impl Unpin for NearMissGenerator
impl UnsafeUnpin for NearMissGenerator
impl UnwindSafe for NearMissGenerator
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
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
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
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.