class sklearn.cluster.bicluster.SpectralCoclustering(n_clusters=3, svd_method=’randomized’, n_svd_vecs=None, mini_batch=False, init=’k-means++’, n_init=10, n_jobs=None, random_state=None)
[source]
Spectral Co-Clustering algorithm (Dhillon, 2001).
Clusters rows and columns of an array X
to solve the relaxed normalized cut of the bipartite graph created from X
as follows: the edge between row vertex i
and column vertex j
has weight X[i, j]
.
The resulting bicluster structure is block-diagonal, since each row and each column belongs to exactly one bicluster.
Supports sparse matrices, as long as they are nonnegative.
Read more in the User Guide.
Parameters: |
|
---|---|
Attributes: |
|
>>> from sklearn.cluster import SpectralCoclustering >>> import numpy as np >>> X = np.array([[1, 1], [2, 1], [1, 0], ... [4, 7], [3, 5], [3, 6]]) >>> clustering = SpectralCoclustering(n_clusters=2, random_state=0).fit(X) >>> clustering.row_labels_ array([0, 1, 1, 0, 0, 0], dtype=int32) >>> clustering.column_labels_ array([0, 0], dtype=int32) >>> clustering SpectralCoclustering(init='k-means++', mini_batch=False, n_clusters=2, n_init=10, n_jobs=None, n_svd_vecs=None, random_state=0, svd_method='randomized')
fit (X[, y]) | Creates a biclustering for X. |
get_indices (i) | Row and column indices of the i’th bicluster. |
get_params ([deep]) | Get parameters for this estimator. |
get_shape (i) | Shape of the i’th bicluster. |
get_submatrix (i, data) | Returns the submatrix corresponding to bicluster i . |
set_params (**params) | Set the parameters of this estimator. |
__init__(n_clusters=3, svd_method=’randomized’, n_svd_vecs=None, mini_batch=False, init=’k-means++’, n_init=10, n_jobs=None, random_state=None)
[source]
biclusters_
Convenient way to get row and column indicators together.
Returns the rows_
and columns_
members.
fit(X, y=None)
[source]
Creates a biclustering for X.
Parameters: |
|
---|
get_indices(i)
[source]
Row and column indices of the i’th bicluster.
Only works if rows_
and columns_
attributes exist.
Parameters: |
|
---|---|
Returns: |
|
get_params(deep=True)
[source]
Get parameters for this estimator.
Parameters: |
|
---|---|
Returns: |
|
get_shape(i)
[source]
Shape of the i’th bicluster.
Parameters: |
|
---|---|
Returns: |
|
get_submatrix(i, data)
[source]
Returns the submatrix corresponding to bicluster i
.
Parameters: |
|
---|---|
Returns: |
|
Works with sparse matrices. Only works if rows_
and columns_
attributes exist.
set_params(**params)
[source]
Set the parameters of this estimator.
The method works on simple estimators as well as on nested objects (such as pipelines). The latter have parameters of the form <component>__<parameter>
so that it’s possible to update each component of a nested object.
Returns: |
|
---|
© 2007–2018 The scikit-learn developers
Licensed under the 3-clause BSD License.
http://scikit-learn.org/stable/modules/generated/sklearn.cluster.bicluster.SpectralCoclustering.html