doc_content stringlengths 1 386k | doc_id stringlengths 5 188 |
|---|---|
class sklearn.cluster.AffinityPropagation(*, damping=0.5, max_iter=200, convergence_iter=15, copy=True, preference=None, affinity='euclidean', verbose=False, random_state='warn') [source]
Perform Affinity Propagation Clustering of data. Read more in the User Guide. Parameters
dampingfloat, default=0.5
Damping f... | sklearn.modules.generated.sklearn.cluster.affinitypropagation#sklearn.cluster.AffinityPropagation |
sklearn.cluster.AffinityPropagation
class sklearn.cluster.AffinityPropagation(*, damping=0.5, max_iter=200, convergence_iter=15, copy=True, preference=None, affinity='euclidean', verbose=False, random_state='warn') [source]
Perform Affinity Propagation Clustering of data. Read more in the User Guide. Parameters
... | sklearn.modules.generated.sklearn.cluster.affinitypropagation |
fit(X, y=None) [source]
Fit the clustering from features, or affinity matrix. Parameters
X{array-like, sparse matrix} of shape (n_samples, n_features), or array-like of shape (n_samples, n_samples)
Training instances to cluster, or similarities / affinities between instances if affinity='precomputed'. If a spar... | sklearn.modules.generated.sklearn.cluster.affinitypropagation#sklearn.cluster.AffinityPropagation.fit |
fit_predict(X, y=None) [source]
Fit the clustering from features or affinity matrix, and return cluster labels. Parameters
X{array-like, sparse matrix} of shape (n_samples, n_features), or array-like of shape (n_samples, n_samples)
Training instances to cluster, or similarities / affinities between instances if... | sklearn.modules.generated.sklearn.cluster.affinitypropagation#sklearn.cluster.AffinityPropagation.fit_predict |
get_params(deep=True) [source]
Get parameters for this estimator. Parameters
deepbool, default=True
If True, will return the parameters for this estimator and contained subobjects that are estimators. Returns
paramsdict
Parameter names mapped to their values. | sklearn.modules.generated.sklearn.cluster.affinitypropagation#sklearn.cluster.AffinityPropagation.get_params |
predict(X) [source]
Predict the closest cluster each sample in X belongs to. Parameters
X{array-like, sparse matrix} of shape (n_samples, n_features)
New data to predict. If a sparse matrix is provided, it will be converted into a sparse csr_matrix. Returns
labelsndarray of shape (n_samples,)
Cluster la... | sklearn.modules.generated.sklearn.cluster.affinitypropagation#sklearn.cluster.AffinityPropagation.predict |
set_params(**params) [source]
Set the parameters of this estimator. The method works on simple estimators as well as on nested objects (such as Pipeline). The latter have parameters of the form <component>__<parameter> so that it’s possible to update each component of a nested object. Parameters
**paramsdict
Es... | sklearn.modules.generated.sklearn.cluster.affinitypropagation#sklearn.cluster.AffinityPropagation.set_params |
sklearn.cluster.affinity_propagation(S, *, preference=None, convergence_iter=15, max_iter=200, damping=0.5, copy=True, verbose=False, return_n_iter=False, random_state='warn') [source]
Perform Affinity Propagation Clustering of data. Read more in the User Guide. Parameters
Sarray-like of shape (n_samples, n_sampl... | sklearn.modules.generated.sklearn.cluster.affinity_propagation#sklearn.cluster.affinity_propagation |
class sklearn.cluster.AgglomerativeClustering(n_clusters=2, *, affinity='euclidean', memory=None, connectivity=None, compute_full_tree='auto', linkage='ward', distance_threshold=None, compute_distances=False) [source]
Agglomerative Clustering Recursively merges the pair of clusters that minimally increases a given li... | sklearn.modules.generated.sklearn.cluster.agglomerativeclustering#sklearn.cluster.AgglomerativeClustering |
sklearn.cluster.AgglomerativeClustering
class sklearn.cluster.AgglomerativeClustering(n_clusters=2, *, affinity='euclidean', memory=None, connectivity=None, compute_full_tree='auto', linkage='ward', distance_threshold=None, compute_distances=False) [source]
Agglomerative Clustering Recursively merges the pair of cl... | sklearn.modules.generated.sklearn.cluster.agglomerativeclustering |
fit(X, y=None) [source]
Fit the hierarchical clustering from features, or distance matrix. Parameters
Xarray-like, shape (n_samples, n_features) or (n_samples, n_samples)
Training instances to cluster, or distances between instances if affinity='precomputed'.
yIgnored
Not used, present here for API consiste... | sklearn.modules.generated.sklearn.cluster.agglomerativeclustering#sklearn.cluster.AgglomerativeClustering.fit |
fit_predict(X, y=None) [source]
Fit the hierarchical clustering from features or distance matrix, and return cluster labels. Parameters
Xarray-like of shape (n_samples, n_features) or (n_samples, n_samples)
Training instances to cluster, or distances between instances if affinity='precomputed'.
yIgnored
Not... | sklearn.modules.generated.sklearn.cluster.agglomerativeclustering#sklearn.cluster.AgglomerativeClustering.fit_predict |
get_params(deep=True) [source]
Get parameters for this estimator. Parameters
deepbool, default=True
If True, will return the parameters for this estimator and contained subobjects that are estimators. Returns
paramsdict
Parameter names mapped to their values. | sklearn.modules.generated.sklearn.cluster.agglomerativeclustering#sklearn.cluster.AgglomerativeClustering.get_params |
set_params(**params) [source]
Set the parameters of this estimator. The method works on simple estimators as well as on nested objects (such as Pipeline). The latter have parameters of the form <component>__<parameter> so that it’s possible to update each component of a nested object. Parameters
**paramsdict
Es... | sklearn.modules.generated.sklearn.cluster.agglomerativeclustering#sklearn.cluster.AgglomerativeClustering.set_params |
class sklearn.cluster.Birch(*, threshold=0.5, branching_factor=50, n_clusters=3, compute_labels=True, copy=True) [source]
Implements the Birch clustering algorithm. It is a memory-efficient, online-learning algorithm provided as an alternative to MiniBatchKMeans. It constructs a tree data structure with the cluster c... | sklearn.modules.generated.sklearn.cluster.birch#sklearn.cluster.Birch |
sklearn.cluster.Birch
class sklearn.cluster.Birch(*, threshold=0.5, branching_factor=50, n_clusters=3, compute_labels=True, copy=True) [source]
Implements the Birch clustering algorithm. It is a memory-efficient, online-learning algorithm provided as an alternative to MiniBatchKMeans. It constructs a tree data stru... | sklearn.modules.generated.sklearn.cluster.birch |
fit(X, y=None) [source]
Build a CF Tree for the input data. Parameters
X{array-like, sparse matrix} of shape (n_samples, n_features)
Input data.
yIgnored
Not used, present here for API consistency by convention. Returns
self
Fitted estimator. | sklearn.modules.generated.sklearn.cluster.birch#sklearn.cluster.Birch.fit |
fit_predict(X, y=None) [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. Returns
labelsndarray of shape (n_samples,), dtype=np.int64
Cluster labels. | sklearn.modules.generated.sklearn.cluster.birch#sklearn.cluster.Birch.fit_predict |
fit_transform(X, y=None, **fit_params) [source]
Fit to data, then transform it. Fits transformer to X and y with optional parameters fit_params and returns a transformed version of X. Parameters
Xarray-like of shape (n_samples, n_features)
Input samples.
yarray-like of shape (n_samples,) or (n_samples, n_outp... | sklearn.modules.generated.sklearn.cluster.birch#sklearn.cluster.Birch.fit_transform |
get_params(deep=True) [source]
Get parameters for this estimator. Parameters
deepbool, default=True
If True, will return the parameters for this estimator and contained subobjects that are estimators. Returns
paramsdict
Parameter names mapped to their values. | sklearn.modules.generated.sklearn.cluster.birch#sklearn.cluster.Birch.get_params |
partial_fit(X=None, y=None) [source]
Online learning. Prevents rebuilding of CFTree from scratch. Parameters
X{array-like, sparse matrix} of shape (n_samples, n_features), default=None
Input data. If X is not provided, only the global clustering step is done.
yIgnored
Not used, present here for API consiste... | sklearn.modules.generated.sklearn.cluster.birch#sklearn.cluster.Birch.partial_fit |
predict(X) [source]
Predict data using the centroids_ of subclusters. Avoid computation of the row norms of X. Parameters
X{array-like, sparse matrix} of shape (n_samples, n_features)
Input data. Returns
labelsndarray of shape(n_samples,)
Labelled data. | sklearn.modules.generated.sklearn.cluster.birch#sklearn.cluster.Birch.predict |
set_params(**params) [source]
Set the parameters of this estimator. The method works on simple estimators as well as on nested objects (such as Pipeline). The latter have parameters of the form <component>__<parameter> so that it’s possible to update each component of a nested object. Parameters
**paramsdict
Es... | sklearn.modules.generated.sklearn.cluster.birch#sklearn.cluster.Birch.set_params |
transform(X) [source]
Transform X into subcluster centroids dimension. Each dimension represents the distance from the sample point to each cluster centroid. Parameters
X{array-like, sparse matrix} of shape (n_samples, n_features)
Input data. Returns
X_trans{array-like, sparse matrix} of shape (n_samples,... | sklearn.modules.generated.sklearn.cluster.birch#sklearn.cluster.Birch.transform |
sklearn.cluster.cluster_optics_dbscan(*, reachability, core_distances, ordering, eps) [source]
Performs DBSCAN extraction for an arbitrary epsilon. Extracting the clusters runs in linear time. Note that this results in labels_ which are close to a DBSCAN with similar settings and eps, only if eps is close to max_eps.... | sklearn.modules.generated.sklearn.cluster.cluster_optics_dbscan#sklearn.cluster.cluster_optics_dbscan |
sklearn.cluster.cluster_optics_xi(*, reachability, predecessor, ordering, min_samples, min_cluster_size=None, xi=0.05, predecessor_correction=True) [source]
Automatically extract clusters according to the Xi-steep method. Parameters
reachabilityndarray of shape (n_samples,)
Reachability distances calculated by ... | sklearn.modules.generated.sklearn.cluster.cluster_optics_xi#sklearn.cluster.cluster_optics_xi |
sklearn.cluster.compute_optics_graph(X, *, min_samples, max_eps, metric, p, metric_params, algorithm, leaf_size, n_jobs) [source]
Computes the OPTICS reachability graph. Read more in the User Guide. Parameters
Xndarray of shape (n_samples, n_features), or (n_samples, n_samples) if metric=’precomputed’.
A featur... | sklearn.modules.generated.sklearn.cluster.compute_optics_graph#sklearn.cluster.compute_optics_graph |
class sklearn.cluster.DBSCAN(eps=0.5, *, min_samples=5, metric='euclidean', metric_params=None, algorithm='auto', leaf_size=30, p=None, n_jobs=None) [source]
Perform DBSCAN clustering from vector array or distance matrix. DBSCAN - Density-Based Spatial Clustering of Applications with Noise. Finds core samples of high... | sklearn.modules.generated.sklearn.cluster.dbscan#sklearn.cluster.DBSCAN |
sklearn.cluster.DBSCAN
class sklearn.cluster.DBSCAN(eps=0.5, *, min_samples=5, metric='euclidean', metric_params=None, algorithm='auto', leaf_size=30, p=None, n_jobs=None) [source]
Perform DBSCAN clustering from vector array or distance matrix. DBSCAN - Density-Based Spatial Clustering of Applications with Noise. F... | sklearn.modules.generated.sklearn.cluster.dbscan |
sklearn.cluster.dbscan(X, eps=0.5, *, min_samples=5, metric='minkowski', metric_params=None, algorithm='auto', leaf_size=30, p=2, sample_weight=None, n_jobs=None) [source]
Perform DBSCAN clustering from vector array or distance matrix. Read more in the User Guide. Parameters
X{array-like, sparse (CSR) matrix} of ... | sklearn.modules.generated.dbscan-function#sklearn.cluster.dbscan |
fit(X, y=None, sample_weight=None) [source]
Perform DBSCAN clustering from features, or distance matrix. Parameters
X{array-like, sparse matrix} of shape (n_samples, n_features), or (n_samples, n_samples)
Training instances to cluster, or distances between instances if metric='precomputed'. If a sparse matrix i... | sklearn.modules.generated.sklearn.cluster.dbscan#sklearn.cluster.DBSCAN.fit |
fit_predict(X, y=None, sample_weight=None) [source]
Perform DBSCAN clustering from features or distance matrix, and return cluster labels. Parameters
X{array-like, sparse matrix} of shape (n_samples, n_features), or (n_samples, n_samples)
Training instances to cluster, or distances between instances if metric='... | sklearn.modules.generated.sklearn.cluster.dbscan#sklearn.cluster.DBSCAN.fit_predict |
get_params(deep=True) [source]
Get parameters for this estimator. Parameters
deepbool, default=True
If True, will return the parameters for this estimator and contained subobjects that are estimators. Returns
paramsdict
Parameter names mapped to their values. | sklearn.modules.generated.sklearn.cluster.dbscan#sklearn.cluster.DBSCAN.get_params |
set_params(**params) [source]
Set the parameters of this estimator. The method works on simple estimators as well as on nested objects (such as Pipeline). The latter have parameters of the form <component>__<parameter> so that it’s possible to update each component of a nested object. Parameters
**paramsdict
Es... | sklearn.modules.generated.sklearn.cluster.dbscan#sklearn.cluster.DBSCAN.set_params |
sklearn.cluster.estimate_bandwidth(X, *, quantile=0.3, n_samples=None, random_state=0, n_jobs=None) [source]
Estimate the bandwidth to use with the mean-shift algorithm. That this function takes time at least quadratic in n_samples. For large datasets, it’s wise to set that parameter to a small value. Parameters
... | sklearn.modules.generated.sklearn.cluster.estimate_bandwidth#sklearn.cluster.estimate_bandwidth |
class sklearn.cluster.FeatureAgglomeration(n_clusters=2, *, affinity='euclidean', memory=None, connectivity=None, compute_full_tree='auto', linkage='ward', pooling_func=<function mean>, distance_threshold=None, compute_distances=False) [source]
Agglomerate features. Similar to AgglomerativeClustering, but recursively... | sklearn.modules.generated.sklearn.cluster.featureagglomeration#sklearn.cluster.FeatureAgglomeration |
sklearn.cluster.FeatureAgglomeration
class sklearn.cluster.FeatureAgglomeration(n_clusters=2, *, affinity='euclidean', memory=None, connectivity=None, compute_full_tree='auto', linkage='ward', pooling_func=<function mean>, distance_threshold=None, compute_distances=False) [source]
Agglomerate features. Similar to A... | sklearn.modules.generated.sklearn.cluster.featureagglomeration |
fit(X, y=None, **params) [source]
Fit the hierarchical clustering on the data Parameters
Xarray-like of shape (n_samples, n_features)
The data
yIgnored
Returns
self | sklearn.modules.generated.sklearn.cluster.featureagglomeration#sklearn.cluster.FeatureAgglomeration.fit |
property fit_predict
Fit the hierarchical clustering from features or distance matrix, and return cluster labels. Parameters
Xarray-like of shape (n_samples, n_features) or (n_samples, n_samples)
Training instances to cluster, or distances between instances if affinity='precomputed'.
yIgnored
Not used, pres... | sklearn.modules.generated.sklearn.cluster.featureagglomeration#sklearn.cluster.FeatureAgglomeration.fit_predict |
fit_transform(X, y=None, **fit_params) [source]
Fit to data, then transform it. Fits transformer to X and y with optional parameters fit_params and returns a transformed version of X. Parameters
Xarray-like of shape (n_samples, n_features)
Input samples.
yarray-like of shape (n_samples,) or (n_samples, n_outp... | sklearn.modules.generated.sklearn.cluster.featureagglomeration#sklearn.cluster.FeatureAgglomeration.fit_transform |
get_params(deep=True) [source]
Get parameters for this estimator. Parameters
deepbool, default=True
If True, will return the parameters for this estimator and contained subobjects that are estimators. Returns
paramsdict
Parameter names mapped to their values. | sklearn.modules.generated.sklearn.cluster.featureagglomeration#sklearn.cluster.FeatureAgglomeration.get_params |
inverse_transform(Xred) [source]
Inverse the transformation. Return a vector of size nb_features with the values of Xred assigned to each group of features Parameters
Xredarray-like of shape (n_samples, n_clusters) or (n_clusters,)
The values to be assigned to each cluster of samples Returns
Xndarray of s... | sklearn.modules.generated.sklearn.cluster.featureagglomeration#sklearn.cluster.FeatureAgglomeration.inverse_transform |
set_params(**params) [source]
Set the parameters of this estimator. The method works on simple estimators as well as on nested objects (such as Pipeline). The latter have parameters of the form <component>__<parameter> so that it’s possible to update each component of a nested object. Parameters
**paramsdict
Es... | sklearn.modules.generated.sklearn.cluster.featureagglomeration#sklearn.cluster.FeatureAgglomeration.set_params |
transform(X) [source]
Transform a new matrix using the built clustering Parameters
Xarray-like of shape (n_samples, n_features) or (n_samples,)
A M by N array of M observations in N dimensions or a length M array of M one-dimensional observations. Returns
Yndarray of shape (n_samples, n_clusters) or (n_cl... | sklearn.modules.generated.sklearn.cluster.featureagglomeration#sklearn.cluster.FeatureAgglomeration.transform |
class sklearn.cluster.KMeans(n_clusters=8, *, init='k-means++', n_init=10, max_iter=300, tol=0.0001, precompute_distances='deprecated', verbose=0, random_state=None, copy_x=True, n_jobs='deprecated', algorithm='auto') [source]
K-Means clustering. Read more in the User Guide. Parameters
n_clustersint, default=8
... | sklearn.modules.generated.sklearn.cluster.kmeans#sklearn.cluster.KMeans |
sklearn.cluster.KMeans
class sklearn.cluster.KMeans(n_clusters=8, *, init='k-means++', n_init=10, max_iter=300, tol=0.0001, precompute_distances='deprecated', verbose=0, random_state=None, copy_x=True, n_jobs='deprecated', algorithm='auto') [source]
K-Means clustering. Read more in the User Guide. Parameters
n_... | sklearn.modules.generated.sklearn.cluster.kmeans |
fit(X, y=None, sample_weight=None) [source]
Compute k-means clustering. Parameters
X{array-like, sparse matrix} of shape (n_samples, n_features)
Training instances to cluster. It must be noted that the data will be converted to C ordering, which will cause a memory copy if the given data is not C-contiguous. If... | sklearn.modules.generated.sklearn.cluster.kmeans#sklearn.cluster.KMeans.fit |
fit_predict(X, y=None, sample_weight=None) [source]
Compute cluster centers and predict cluster index for each sample. Convenience method; equivalent to calling fit(X) followed by predict(X). Parameters
X{array-like, sparse matrix} of shape (n_samples, n_features)
New data to transform.
yIgnored
Not used, p... | sklearn.modules.generated.sklearn.cluster.kmeans#sklearn.cluster.KMeans.fit_predict |
fit_transform(X, y=None, sample_weight=None) [source]
Compute clustering and transform X to cluster-distance space. Equivalent to fit(X).transform(X), but more efficiently implemented. Parameters
X{array-like, sparse matrix} of shape (n_samples, n_features)
New data to transform.
yIgnored
Not used, present ... | sklearn.modules.generated.sklearn.cluster.kmeans#sklearn.cluster.KMeans.fit_transform |
get_params(deep=True) [source]
Get parameters for this estimator. Parameters
deepbool, default=True
If True, will return the parameters for this estimator and contained subobjects that are estimators. Returns
paramsdict
Parameter names mapped to their values. | sklearn.modules.generated.sklearn.cluster.kmeans#sklearn.cluster.KMeans.get_params |
predict(X, sample_weight=None) [source]
Predict the closest cluster each sample in X belongs to. In the vector quantization literature, cluster_centers_ is called the code book and each value returned by predict is the index of the closest code in the code book. Parameters
X{array-like, sparse matrix} of shape (n... | sklearn.modules.generated.sklearn.cluster.kmeans#sklearn.cluster.KMeans.predict |
score(X, y=None, sample_weight=None) [source]
Opposite of the value of X on the K-means objective. Parameters
X{array-like, sparse matrix} of shape (n_samples, n_features)
New data.
yIgnored
Not used, present here for API consistency by convention.
sample_weightarray-like of shape (n_samples,), default=No... | sklearn.modules.generated.sklearn.cluster.kmeans#sklearn.cluster.KMeans.score |
set_params(**params) [source]
Set the parameters of this estimator. The method works on simple estimators as well as on nested objects (such as Pipeline). The latter have parameters of the form <component>__<parameter> so that it’s possible to update each component of a nested object. Parameters
**paramsdict
Es... | sklearn.modules.generated.sklearn.cluster.kmeans#sklearn.cluster.KMeans.set_params |
transform(X) [source]
Transform X to a cluster-distance space. In the new space, each dimension is the distance to the cluster centers. Note that even if X is sparse, the array returned by transform will typically be dense. Parameters
X{array-like, sparse matrix} of shape (n_samples, n_features)
New data to tra... | sklearn.modules.generated.sklearn.cluster.kmeans#sklearn.cluster.KMeans.transform |
sklearn.cluster.kmeans_plusplus(X, n_clusters, *, x_squared_norms=None, random_state=None, n_local_trials=None) [source]
Init n_clusters seeds according to k-means++ New in version 0.24. Parameters
X{array-like, sparse matrix} of shape (n_samples, n_features)
The data to pick seeds from.
n_clustersint
The... | sklearn.modules.generated.sklearn.cluster.kmeans_plusplus#sklearn.cluster.kmeans_plusplus |
sklearn.cluster.k_means(X, n_clusters, *, sample_weight=None, init='k-means++', precompute_distances='deprecated', n_init=10, max_iter=300, verbose=False, tol=0.0001, random_state=None, copy_x=True, n_jobs='deprecated', algorithm='auto', return_n_iter=False) [source]
K-means clustering algorithm. Read more in the Use... | sklearn.modules.generated.sklearn.cluster.k_means#sklearn.cluster.k_means |
class sklearn.cluster.MeanShift(*, bandwidth=None, seeds=None, bin_seeding=False, min_bin_freq=1, cluster_all=True, n_jobs=None, max_iter=300) [source]
Mean shift clustering using a flat kernel. Mean shift clustering aims to discover “blobs” in a smooth density of samples. It is a centroid-based algorithm, which work... | sklearn.modules.generated.sklearn.cluster.meanshift#sklearn.cluster.MeanShift |
sklearn.cluster.MeanShift
class sklearn.cluster.MeanShift(*, bandwidth=None, seeds=None, bin_seeding=False, min_bin_freq=1, cluster_all=True, n_jobs=None, max_iter=300) [source]
Mean shift clustering using a flat kernel. Mean shift clustering aims to discover “blobs” in a smooth density of samples. It is a centroid... | sklearn.modules.generated.sklearn.cluster.meanshift |
fit(X, y=None) [source]
Perform clustering. Parameters
Xarray-like of shape (n_samples, n_features)
Samples to cluster.
yIgnored | sklearn.modules.generated.sklearn.cluster.meanshift#sklearn.cluster.MeanShift.fit |
fit_predict(X, y=None) [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. Returns
labelsndarray of shape (n_samples,), dtype=np.int64
Cluster labels. | sklearn.modules.generated.sklearn.cluster.meanshift#sklearn.cluster.MeanShift.fit_predict |
get_params(deep=True) [source]
Get parameters for this estimator. Parameters
deepbool, default=True
If True, will return the parameters for this estimator and contained subobjects that are estimators. Returns
paramsdict
Parameter names mapped to their values. | sklearn.modules.generated.sklearn.cluster.meanshift#sklearn.cluster.MeanShift.get_params |
predict(X) [source]
Predict the closest cluster each sample in X belongs to. Parameters
X{array-like, sparse matrix} of shape (n_samples, n_features)
New data to predict. Returns
labelsndarray of shape (n_samples,)
Index of the cluster each sample belongs to. | sklearn.modules.generated.sklearn.cluster.meanshift#sklearn.cluster.MeanShift.predict |
set_params(**params) [source]
Set the parameters of this estimator. The method works on simple estimators as well as on nested objects (such as Pipeline). The latter have parameters of the form <component>__<parameter> so that it’s possible to update each component of a nested object. Parameters
**paramsdict
Es... | sklearn.modules.generated.sklearn.cluster.meanshift#sklearn.cluster.MeanShift.set_params |
sklearn.cluster.mean_shift(X, *, bandwidth=None, seeds=None, bin_seeding=False, min_bin_freq=1, cluster_all=True, max_iter=300, n_jobs=None) [source]
Perform mean shift clustering of data using a flat kernel. Read more in the User Guide. Parameters
Xarray-like of shape (n_samples, n_features)
Input data.
band... | sklearn.modules.generated.sklearn.cluster.mean_shift#sklearn.cluster.mean_shift |
class sklearn.cluster.MiniBatchKMeans(n_clusters=8, *, init='k-means++', max_iter=100, batch_size=100, verbose=0, compute_labels=True, random_state=None, tol=0.0, max_no_improvement=10, init_size=None, n_init=3, reassignment_ratio=0.01) [source]
Mini-Batch K-Means clustering. Read more in the User Guide. Parameters ... | sklearn.modules.generated.sklearn.cluster.minibatchkmeans#sklearn.cluster.MiniBatchKMeans |
sklearn.cluster.MiniBatchKMeans
class sklearn.cluster.MiniBatchKMeans(n_clusters=8, *, init='k-means++', max_iter=100, batch_size=100, verbose=0, compute_labels=True, random_state=None, tol=0.0, max_no_improvement=10, init_size=None, n_init=3, reassignment_ratio=0.01) [source]
Mini-Batch K-Means clustering. Read mo... | sklearn.modules.generated.sklearn.cluster.minibatchkmeans |
fit(X, y=None, sample_weight=None) [source]
Compute the centroids on X by chunking it into mini-batches. Parameters
X{array-like, sparse matrix} of shape (n_samples, n_features)
Training instances to cluster. It must be noted that the data will be converted to C ordering, which will cause a memory copy if the g... | sklearn.modules.generated.sklearn.cluster.minibatchkmeans#sklearn.cluster.MiniBatchKMeans.fit |
fit_predict(X, y=None, sample_weight=None) [source]
Compute cluster centers and predict cluster index for each sample. Convenience method; equivalent to calling fit(X) followed by predict(X). Parameters
X{array-like, sparse matrix} of shape (n_samples, n_features)
New data to transform.
yIgnored
Not used, p... | sklearn.modules.generated.sklearn.cluster.minibatchkmeans#sklearn.cluster.MiniBatchKMeans.fit_predict |
fit_transform(X, y=None, sample_weight=None) [source]
Compute clustering and transform X to cluster-distance space. Equivalent to fit(X).transform(X), but more efficiently implemented. Parameters
X{array-like, sparse matrix} of shape (n_samples, n_features)
New data to transform.
yIgnored
Not used, present ... | sklearn.modules.generated.sklearn.cluster.minibatchkmeans#sklearn.cluster.MiniBatchKMeans.fit_transform |
get_params(deep=True) [source]
Get parameters for this estimator. Parameters
deepbool, default=True
If True, will return the parameters for this estimator and contained subobjects that are estimators. Returns
paramsdict
Parameter names mapped to their values. | sklearn.modules.generated.sklearn.cluster.minibatchkmeans#sklearn.cluster.MiniBatchKMeans.get_params |
partial_fit(X, y=None, sample_weight=None) [source]
Update k means estimate on a single mini-batch X. Parameters
Xarray-like of shape (n_samples, n_features)
Coordinates of the data points to cluster. It must be noted that X will be copied if it is not C-contiguous.
yIgnored
Not used, present here for API c... | sklearn.modules.generated.sklearn.cluster.minibatchkmeans#sklearn.cluster.MiniBatchKMeans.partial_fit |
predict(X, sample_weight=None) [source]
Predict the closest cluster each sample in X belongs to. In the vector quantization literature, cluster_centers_ is called the code book and each value returned by predict is the index of the closest code in the code book. Parameters
X{array-like, sparse matrix} of shape (n... | sklearn.modules.generated.sklearn.cluster.minibatchkmeans#sklearn.cluster.MiniBatchKMeans.predict |
score(X, y=None, sample_weight=None) [source]
Opposite of the value of X on the K-means objective. Parameters
X{array-like, sparse matrix} of shape (n_samples, n_features)
New data.
yIgnored
Not used, present here for API consistency by convention.
sample_weightarray-like of shape (n_samples,), default=No... | sklearn.modules.generated.sklearn.cluster.minibatchkmeans#sklearn.cluster.MiniBatchKMeans.score |
set_params(**params) [source]
Set the parameters of this estimator. The method works on simple estimators as well as on nested objects (such as Pipeline). The latter have parameters of the form <component>__<parameter> so that it’s possible to update each component of a nested object. Parameters
**paramsdict
Es... | sklearn.modules.generated.sklearn.cluster.minibatchkmeans#sklearn.cluster.MiniBatchKMeans.set_params |
transform(X) [source]
Transform X to a cluster-distance space. In the new space, each dimension is the distance to the cluster centers. Note that even if X is sparse, the array returned by transform will typically be dense. Parameters
X{array-like, sparse matrix} of shape (n_samples, n_features)
New data to tra... | sklearn.modules.generated.sklearn.cluster.minibatchkmeans#sklearn.cluster.MiniBatchKMeans.transform |
class sklearn.cluster.OPTICS(*, min_samples=5, max_eps=inf, metric='minkowski', p=2, metric_params=None, cluster_method='xi', eps=None, xi=0.05, predecessor_correction=True, min_cluster_size=None, algorithm='auto', leaf_size=30, n_jobs=None) [source]
Estimate clustering structure from vector array. OPTICS (Ordering P... | sklearn.modules.generated.sklearn.cluster.optics#sklearn.cluster.OPTICS |
sklearn.cluster.OPTICS
class sklearn.cluster.OPTICS(*, min_samples=5, max_eps=inf, metric='minkowski', p=2, metric_params=None, cluster_method='xi', eps=None, xi=0.05, predecessor_correction=True, min_cluster_size=None, algorithm='auto', leaf_size=30, n_jobs=None) [source]
Estimate clustering structure from vector ... | sklearn.modules.generated.sklearn.cluster.optics |
fit(X, y=None) [source]
Perform OPTICS clustering. Extracts an ordered list of points and reachability distances, and performs initial clustering using max_eps distance specified at OPTICS object instantiation. Parameters
Xndarray of shape (n_samples, n_features), or (n_samples, n_samples) if metric=’precomputed’... | sklearn.modules.generated.sklearn.cluster.optics#sklearn.cluster.OPTICS.fit |
fit_predict(X, y=None) [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. Returns
labelsndarray of shape (n_samples,), dtype=np.int64
Cluster labels. | sklearn.modules.generated.sklearn.cluster.optics#sklearn.cluster.OPTICS.fit_predict |
get_params(deep=True) [source]
Get parameters for this estimator. Parameters
deepbool, default=True
If True, will return the parameters for this estimator and contained subobjects that are estimators. Returns
paramsdict
Parameter names mapped to their values. | sklearn.modules.generated.sklearn.cluster.optics#sklearn.cluster.OPTICS.get_params |
set_params(**params) [source]
Set the parameters of this estimator. The method works on simple estimators as well as on nested objects (such as Pipeline). The latter have parameters of the form <component>__<parameter> so that it’s possible to update each component of a nested object. Parameters
**paramsdict
Es... | sklearn.modules.generated.sklearn.cluster.optics#sklearn.cluster.OPTICS.set_params |
class sklearn.cluster.SpectralBiclustering(n_clusters=3, *, method='bistochastic', n_components=6, n_best=3, svd_method='randomized', n_svd_vecs=None, mini_batch=False, init='k-means++', n_init=10, n_jobs='deprecated', random_state=None) [source]
Spectral biclustering (Kluger, 2003). Partitions rows and columns under... | sklearn.modules.generated.sklearn.cluster.spectralbiclustering#sklearn.cluster.SpectralBiclustering |
sklearn.cluster.SpectralBiclustering
class sklearn.cluster.SpectralBiclustering(n_clusters=3, *, method='bistochastic', n_components=6, n_best=3, svd_method='randomized', n_svd_vecs=None, mini_batch=False, init='k-means++', n_init=10, n_jobs='deprecated', random_state=None) [source]
Spectral biclustering (Kluger, 2... | sklearn.modules.generated.sklearn.cluster.spectralbiclustering |
property biclusters_
Convenient way to get row and column indicators together. Returns the rows_ and columns_ members. | sklearn.modules.generated.sklearn.cluster.spectralbiclustering#sklearn.cluster.SpectralBiclustering.biclusters_ |
fit(X, y=None) [source]
Creates a biclustering for X. Parameters
Xarray-like of shape (n_samples, n_features)
yIgnored | sklearn.modules.generated.sklearn.cluster.spectralbiclustering#sklearn.cluster.SpectralBiclustering.fit |
get_indices(i) [source]
Row and column indices of the i’th bicluster. Only works if rows_ and columns_ attributes exist. Parameters
iint
The index of the cluster. Returns
row_indndarray, dtype=np.intp
Indices of rows in the dataset that belong to the bicluster.
col_indndarray, dtype=np.intp
Indices ... | sklearn.modules.generated.sklearn.cluster.spectralbiclustering#sklearn.cluster.SpectralBiclustering.get_indices |
get_params(deep=True) [source]
Get parameters for this estimator. Parameters
deepbool, default=True
If True, will return the parameters for this estimator and contained subobjects that are estimators. Returns
paramsdict
Parameter names mapped to their values. | sklearn.modules.generated.sklearn.cluster.spectralbiclustering#sklearn.cluster.SpectralBiclustering.get_params |
get_shape(i) [source]
Shape of the i’th bicluster. Parameters
iint
The index of the cluster. Returns
n_rowsint
Number of rows in the bicluster.
n_colsint
Number of columns in the bicluster. | sklearn.modules.generated.sklearn.cluster.spectralbiclustering#sklearn.cluster.SpectralBiclustering.get_shape |
get_submatrix(i, data) [source]
Return the submatrix corresponding to bicluster i. Parameters
iint
The index of the cluster.
dataarray-like of shape (n_samples, n_features)
The data. Returns
submatrixndarray of shape (n_rows, n_cols)
The submatrix corresponding to bicluster i. Notes Works with s... | sklearn.modules.generated.sklearn.cluster.spectralbiclustering#sklearn.cluster.SpectralBiclustering.get_submatrix |
set_params(**params) [source]
Set the parameters of this estimator. The method works on simple estimators as well as on nested objects (such as Pipeline). The latter have parameters of the form <component>__<parameter> so that it’s possible to update each component of a nested object. Parameters
**paramsdict
Es... | sklearn.modules.generated.sklearn.cluster.spectralbiclustering#sklearn.cluster.SpectralBiclustering.set_params |
class sklearn.cluster.SpectralClustering(n_clusters=8, *, eigen_solver=None, n_components=None, random_state=None, n_init=10, gamma=1.0, affinity='rbf', n_neighbors=10, eigen_tol=0.0, assign_labels='kmeans', degree=3, coef0=1, kernel_params=None, n_jobs=None, verbose=False) [source]
Apply clustering to a projection o... | sklearn.modules.generated.sklearn.cluster.spectralclustering#sklearn.cluster.SpectralClustering |
sklearn.cluster.SpectralClustering
class sklearn.cluster.SpectralClustering(n_clusters=8, *, eigen_solver=None, n_components=None, random_state=None, n_init=10, gamma=1.0, affinity='rbf', n_neighbors=10, eigen_tol=0.0, assign_labels='kmeans', degree=3, coef0=1, kernel_params=None, n_jobs=None, verbose=False) [source]... | sklearn.modules.generated.sklearn.cluster.spectralclustering |
fit(X, y=None) [source]
Perform spectral clustering from features, or affinity matrix. Parameters
X{array-like, sparse matrix} of shape (n_samples, n_features), or array-like of shape (n_samples, n_samples)
Training instances to cluster, or similarities / affinities between instances if affinity='precomputed'. ... | sklearn.modules.generated.sklearn.cluster.spectralclustering#sklearn.cluster.SpectralClustering.fit |
fit_predict(X, y=None) [source]
Perform spectral clustering from features, or affinity matrix, and return cluster labels. Parameters
X{array-like, sparse matrix} of shape (n_samples, n_features), or array-like of shape (n_samples, n_samples)
Training instances to cluster, or similarities / affinities between in... | sklearn.modules.generated.sklearn.cluster.spectralclustering#sklearn.cluster.SpectralClustering.fit_predict |
get_params(deep=True) [source]
Get parameters for this estimator. Parameters
deepbool, default=True
If True, will return the parameters for this estimator and contained subobjects that are estimators. Returns
paramsdict
Parameter names mapped to their values. | sklearn.modules.generated.sklearn.cluster.spectralclustering#sklearn.cluster.SpectralClustering.get_params |
set_params(**params) [source]
Set the parameters of this estimator. The method works on simple estimators as well as on nested objects (such as Pipeline). The latter have parameters of the form <component>__<parameter> so that it’s possible to update each component of a nested object. Parameters
**paramsdict
Es... | sklearn.modules.generated.sklearn.cluster.spectralclustering#sklearn.cluster.SpectralClustering.set_params |
class sklearn.cluster.SpectralCoclustering(n_clusters=3, *, svd_method='randomized', n_svd_vecs=None, mini_batch=False, init='k-means++', n_init=10, n_jobs='deprecated', random_state=None) [source]
Spectral Co-Clustering algorithm (Dhillon, 2001). Clusters rows and columns of an array X to solve the relaxed normalize... | sklearn.modules.generated.sklearn.cluster.spectralcoclustering#sklearn.cluster.SpectralCoclustering |
sklearn.cluster.SpectralCoclustering
class sklearn.cluster.SpectralCoclustering(n_clusters=3, *, svd_method='randomized', n_svd_vecs=None, mini_batch=False, init='k-means++', n_init=10, n_jobs='deprecated', random_state=None) [source]
Spectral Co-Clustering algorithm (Dhillon, 2001). Clusters rows and columns of an... | sklearn.modules.generated.sklearn.cluster.spectralcoclustering |
property biclusters_
Convenient way to get row and column indicators together. Returns the rows_ and columns_ members. | sklearn.modules.generated.sklearn.cluster.spectralcoclustering#sklearn.cluster.SpectralCoclustering.biclusters_ |
fit(X, y=None) [source]
Creates a biclustering for X. Parameters
Xarray-like of shape (n_samples, n_features)
yIgnored | sklearn.modules.generated.sklearn.cluster.spectralcoclustering#sklearn.cluster.SpectralCoclustering.fit |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.