coclust.coclustering.CoclustInfo
¶
-
class
coclust.coclustering.
CoclustInfo
(n_row_clusters=2, n_col_clusters=2, init=None, max_iter=20, n_init=1, tol=1e-09, random_state=None)[source]¶ Information-Theoretic Co-clustering.
Parameters: - n_row_clusters (int, optional, default: 2) – Number of row clusters to form
- n_col_clusters (int, optional, default: 2) – Number of column clusters to form
- init (numpy array or scipy sparse matrix, shape (n_features, n_clusters), optional, default: None) – Initial column labels
- max_iter (int, optional, default: 20) – Maximum number of iterations
- n_init (int, optional, default: 1) – Number of time the algorithm will be run with different initializations. The final results will be the best output of n_init consecutive runs.
- random_state (integer or numpy.RandomState, optional) – The generator used to initialize the centers. If an integer is given, it fixes the seed. Defaults to the global numpy random number generator.
- tol (float, default: 1e-9) – Relative tolerance with regards to criterion to declare convergence
-
row_labels_
¶ array-like, shape (n_rows,) – Bicluster label of each row
-
column_labels_
¶ array-like, shape (n_cols,) – Bicluster label of each column
-
delta_kl_
¶ array-like, shape (k,l) – Value \(\frac{p_{kl}}{p_{k.} \times p_{.l}}\) for each row cluster k and column cluster l
-
fit
(X, y=None)[source]¶ Perform co-clustering.
Parameters: X (numpy array or scipy sparse matrix, shape=(n_samples, n_features)) – Matrix to be analyzed
-
get_col_indices
(i)¶ Give the column indices of the i’th co-cluster.
Parameters: i (integer) – Index of the i’th column cluster Returns: list of column indices Return type: list
-
get_params
(deep=True)¶ Get parameters for this estimator.
Parameters: deep (boolean, optional) – If True, will return the parameters for this estimator and contained subobjects that are estimators. Returns: params – Parameter names mapped to their values. Return type: mapping of string to any
-
get_row_indices
(i)¶ Give the row indices of the i’th co-cluster.
Parameters: i (integer) – Index of the i’th row cluster Returns: list of row indices Return type: list
-
get_shape
(i, j)¶ - Give the shape of block corresponding to the i’th row cluster and
- the j’th column cluster.
Parameters: - i (integer) – Index of the row cluster
- j (integer) – Index of the column cluster
Returns: (number of rows, number of columns)
Return type: (int, int)
-
get_submatrix
(m, i, j)¶ Give the submatrix corresponding to row cluster i and column cluster j.
Parameters: - m (X : numpy array or scipy sparse matrix) – Matrix from which the block has to be extracted
- i (integer) – index of the row cluster
- j (integer) – index of the col cluster
Returns: Submatrix corresponding to row cluster i and column cluster j
Return type: numpy array or scipy sparse matrix
-
set_params
(**params)¶ 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: Return type: self