make_biclusters#

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

为双聚类生成常量块对角结构数组。

用户指南中阅读更多内容。

参数:
shape形状为 (n_rows, n_cols) 的元组

结果的形状。

n_clustersint

双聚类的数量。

noisefloat, default=0.0

高斯噪声的标准差。

minval浮点数, 默认为 10

双聚类的最小值。

maxval浮点数, 默认为 100

双聚类的最大值。

shufflebool, default=True

打乱样本。

random_stateint, RandomState instance or None, default=None

确定数据集创建的随机数生成。传递一个 int 值以在多次函数调用中获得可重现的输出。请参阅词汇表

返回:
X形状为 shape 的 ndarray

生成的数组。

rows形状为 (n_clusters, X.shape[0]) 的 ndarray

每行聚类成员资格的指示器。

cols形状为 (n_clusters, X.shape[1]) 的 ndarray

每列聚类成员资格的指示器。

另请参阅

make_checkerboard

为双聚类生成具有块棋盘结构的数组。

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.

示例

>>> 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)