Toggle Menu
Prev Up Next

scikit-learn 1.3.2
Other versions

Please cite us if you use the software.

# `sklearn.base`.BiclusterMixin

class sklearn.base.BiclusterMixin

  Mixin class for all bicluster estimators in scikit-learn.

  Attributes:
    `biclusters_`

      Convenient way to get row and column indicators together.

  Methods

  `get_indices`(i) | Row and column indices of the `i`'th bicluster.
  `get_shape`(i) | Shape of the `i`'th bicluster.
  `get_submatrix`(i, data) | Return the submatrix corresponding to bicluster `i`.

  property biclusters_

    Convenient way to get row and column indicators together.

    Returns the `rows_` and `columns_` members.

  get_indices(i)

    Row and column indices of the `i`’th bicluster.

    Only works if `rows_` and `columns_` attributes exist.

    Parameters:
      i int

        The index of the cluster.

    Returns:
      row_ind ndarray, dtype=np.intp

        Indices of rows in the dataset that belong to the bicluster.

      col_ind ndarray, dtype=np.intp

        Indices of columns in the dataset that belong to the bicluster.

  get_shape(i)

    Shape of the `i`’th bicluster.

    Parameters:
      i int

        The index of the cluster.

    Returns:
      n_rows int

        Number of rows in the bicluster.

      n_cols int

        Number of columns in the bicluster.

  get_submatrix(i, data)

    Return the submatrix corresponding to bicluster `i`.

    Parameters:
      i int

        The index of the cluster.

      data array-like of shape (n_samples, n_features)

        The data.

    Returns:
      submatrix ndarray of shape (n_rows, n_cols)

        The submatrix corresponding to bicluster `i`.

    Notes

    Works with sparse matrices. Only works if `rows_` and `columns_` attributes exist.