make_biclusters#

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

為雙向分群生成一個常數區塊對角結構陣列。

請在使用者指南中閱讀更多資訊。

參數:
shape形狀為 (n_rows, n_cols) 的元組

結果的形狀。

n_clustersint

雙向群集的數量。

noisefloat,預設值為 0.0

高斯雜訊的標準差。

minvalfloat,預設值為 10

雙向群集的最小值。

maxvalfloat,預設值為 100

雙向群集的最大值。

shufflebool,預設值為 True

是否打亂樣本。

random_stateint、RandomState 實例或 None,預設值為 None

決定資料集建立的隨機數字產生。傳遞 int 以在多個函式呼叫中獲得可重現的輸出。請參閱詞彙表

回傳值:
X形狀為 shape 的 ndarray

產生的陣列。

rows形狀為 (n_clusters, X.shape[0]) 的 ndarray

每個列的群集成員指標。

cols形狀為 (n_clusters, X.shape[1]) 的 ndarray

每個欄的群集成員指標。

另請參閱

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)