pub struct ClusterManager { /* private fields */ }Expand description
Manages anomaly clustering.
Implementations§
Source§impl ClusterManager
impl ClusterManager
Sourcepub fn new(config: ClusteringConfig) -> Self
pub fn new(config: ClusteringConfig) -> Self
Creates a new cluster manager.
Sourcepub fn assign_cluster<R: Rng>(
&mut self,
date: NaiveDate,
anomaly_type: &str,
rng: &mut R,
) -> Option<String>
pub fn assign_cluster<R: Rng>( &mut self, date: NaiveDate, anomaly_type: &str, rng: &mut R, ) -> Option<String>
Determines the cluster ID for a new anomaly.
Sourcepub fn assign_cluster_with_context<R: Rng>(
&mut self,
date: NaiveDate,
anomaly_type: &str,
account: Option<&str>,
entity: Option<&str>,
rng: &mut R,
) -> Option<String>
pub fn assign_cluster_with_context<R: Rng>( &mut self, date: NaiveDate, anomaly_type: &str, account: Option<&str>, entity: Option<&str>, rng: &mut R, ) -> Option<String>
Determines the cluster ID with additional context for relationship preservation.
Sourcepub fn add_causal_link(&mut self, cluster_id: &str, link: CausalLink)
pub fn add_causal_link(&mut self, cluster_id: &str, link: CausalLink)
Add a causal link to a cluster.
Get suggested account for relationship preservation within a cluster.
Get suggested entity for relationship preservation within a cluster.
Sourcepub fn get_cluster_stats(&self, cluster_id: &str) -> Option<&ClusterStats>
pub fn get_cluster_stats(&self, cluster_id: &str) -> Option<&ClusterStats>
Gets cluster statistics.
Sourcepub fn all_cluster_stats(&self) -> &HashMap<String, ClusterStats>
pub fn all_cluster_stats(&self) -> &HashMap<String, ClusterStats>
Gets all cluster statistics.
Sourcepub fn cluster_count(&self) -> usize
pub fn cluster_count(&self) -> usize
Returns the number of clusters created.
Sourcepub fn clusters_by_category(&self) -> HashMap<FraudCategory, Vec<&ClusterStats>>
pub fn clusters_by_category(&self) -> HashMap<FraudCategory, Vec<&ClusterStats>>
Get cluster statistics by fraud category.
Auto Trait Implementations§
impl Freeze for ClusterManager
impl RefUnwindSafe for ClusterManager
impl Send for ClusterManager
impl Sync for ClusterManager
impl Unpin for ClusterManager
impl UnwindSafe for ClusterManager
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