Skip to content

Clusterer

Module: strata.base • Kind: trait • Traits: Estimator
Source: strata/base/estimator.mojo

trait Clusterer(Estimator)
from strata.base import Clusterer

Interface for unsupervised clustering algorithms.


Method Description
Clusterer.fit() Fit the estimator to the provided input data.
Clusterer.predict() Generate predictions for input samples.
Clusterer.fit_predict() Fit the estimator to X and return predicted cluster labels.

def fit[in_dtype: DType](mut self, X: Matrix[in_dtype])

Fit the estimator to the provided input data.

Parameter Type Description
X Matrix[in_dtype] Feature matrix.

def predict[in_dtype: DType](self, X: Matrix[in_dtype]) -> List[Int]

Generate predictions for input samples.

Parameter Type Description
X Matrix[in_dtype] Feature matrix.

Returns: List[Int]


def fit_predict[in_dtype: DType](mut self, X: Matrix[in_dtype]) -> List[Int]

Fit the estimator to X and return predicted cluster labels.

Parameter Type Description
X Matrix[in_dtype] Feature matrix.

Returns: List[Int]