Clusterer
Module: strata.base • Kind: trait • Traits: Estimator
Source: strata/base/estimator.mojo
trait Clusterer(Estimator)from strata.base import ClustererInterface for unsupervised clustering algorithms.
Methods Overview
Section titled “Methods Overview”| 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. |
Method Details
Section titled “Method Details”Clusterer.fit()
Section titled “Clusterer.fit()”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. |
Clusterer.predict()
Section titled “Clusterer.predict()”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]
Clusterer.fit_predict()
Section titled “Clusterer.fit_predict()”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]