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