Skip to main content

Clusterer

Trait Clusterer 

Source
pub trait Clusterer {
    // Required methods
    fn name(&self) -> &'static str;
    fn fit(&mut self, frame: &Frame) -> Result<()>;
    fn predict(&self, frame: &Frame) -> Result<Vec<f64>>;
}
Expand description

An unsupervised cluster model: fit on features alone (no target), then assign each row a cluster label.

This is the contract for inductive clusterers (k-means, GMM) that can label unseen data. Transductive methods that only label their training data (e.g. DBSCAN) expose a fit_predict inherent method instead.

Required Methods§

Source

fn name(&self) -> &'static str

A short, stable name for diagnostics.

Source

fn fit(&mut self, frame: &Frame) -> Result<()>

Learn the clustering from the feature frame.

Source

fn predict(&self, frame: &Frame) -> Result<Vec<f64>>

Assign each row of frame a cluster label.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§