make_biclusters#

sklearn.datasets.make_biclusters(shape, n_clusters, *, noise=0.0, minval=10, maxval=100, shuffle=True, random_state=None)[source]#

Generate a constant block diagonal structure array for biclustering.

Read more in the User Guide.

Parameters:
shapetuple of shape (n_rows, n_cols)

The shape of the result.

n_clustersint

The number of biclusters.

noisefloat, default=0.0

The standard deviation of the gaussian noise.

minvalfloat, default=10

Minimum value of a bicluster.

maxvalfloat, default=100

Maximum value of a bicluster.

shufflebool, default=True

Shuffle the samples.

random_stateint, RandomState instance or None, default=None

Determines random number generation for dataset creation. Pass an int for reproducible output across multiple function calls. See Glossary.

Returns:
Xndarray of shape shape

The generated array.

rowsndarray of shape (n_clusters, X.shape[0])

The indicators for cluster membership of each row.

colsndarray of shape (n_clusters, X.shape[1])

The indicators for cluster membership of each column.

See also

make_checkerboard

Generate an array with block checkerboard structure for biclustering.

References

[1]

Dhillon, I. S. (2001, August). Co-clustering documents and words using bipartite spectral graph partitioning. In Proceedings of the seventh ACM SIGKDD international conference on Knowledge discovery and data mining (pp. 269-274). ACM.

Examples

>>> from sklearn.datasets import make_biclusters
>>> data, rows, cols = make_biclusters(
...     shape=(10, 20), n_clusters=2, random_state=42
... )
>>> data.shape
(10, 20)
>>> rows.shape
(2, 10)
>>> cols.shape
(2, 20)