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_clusters整型
双聚类的数量。
- noise浮点型, 默认值=0.0
高斯噪声的标准差。
- minval浮点型, 默认值=10
双聚类的最小值。
- maxval浮点型, 默认值=100
双聚类的最大值。
- shuffle布尔型, 默认值=True
打乱样本。
- random_state整型, RandomState 实例或 None, 默认值=None
确定数据集创建的随机数生成。传入一个整型值可在多次函数调用中获得可重现的输出。详见术语表。
- 返回:
- X形状为
shape
的 ndarray 生成的数组。
- rows形状为 (n_clusters, X.shape[0]) 的 ndarray
每行聚类成员资格的指示器。
- cols形状为 (n_clusters, X.shape[1]) 的 ndarray
每列聚类成员资格的指示器。
- X形状为
另请参阅
make_checkerboard
生成具有块棋盘结构用于双聚类的数组。
参考文献
[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)