Mixin class for all cluster estimators in scikit-learn.
set estimator type to "clusterer"
through the estimator_type
tag;
fit_predict
method returning the cluster labels associated to each sample.
Examples
>>> import numpy as np >>> from sklearn.base import BaseEstimator, ClusterMixin >>> class MyClusterer(ClusterMixin, BaseEstimator): ... def fit(self, X, y=None): ... self.labels_ = np.ones(shape=(len(X),), dtype=np.int64) ... return self >>> X = [[1, 2], [2, 3], [3, 4]] >>> MyClusterer().fit_predict(X) array([1, 1, 1])
Perform clustering on X
and returns cluster labels.
Input data.
Not used, present for API consistency by convention.
Arguments to be passed to fit
.
Added in version 1.4.
Cluster labels.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4