A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://scikit-learn.org/stable/developers/../modules/generated/sklearn.base.ClusterMixin.html below:

ClusterMixin — scikit-learn 1.7.0 documentation

ClusterMixin#
class sklearn.base.ClusterMixin[source]#

Mixin class for all cluster estimators in scikit-learn.

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])
fit_predict(X, y=None, **kwargs)[source]#

Perform clustering on X and returns cluster labels.

Parameters:
Xarray-like of shape (n_samples, n_features)

Input data.

yIgnored

Not used, present for API consistency by convention.

**kwargsdict

Arguments to be passed to fit.

Added in version 1.4.

Returns:
labelsndarray of shape (n_samples,), dtype=np.int64

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