@@ -889,7 +889,32 @@ def _more_tags(self):
889
889
890
890
891
891
class BiclusterMixin :
892
- """Mixin class for all bicluster estimators in scikit-learn."""
892
+ """Mixin class for all bicluster estimators in scikit-learn.
893
+
894
+ This mixin defines the following functionality:
895
+
896
+ - `biclusters_` property that returns the row and column indicators;
897
+ - `get_indices` method that returns the row and column indices of a bicluster;
898
+ - `get_shape` method that returns the shape of a bicluster;
899
+ - `get_submatrix` method that returns the submatrix corresponding to a bicluster.
900
+
901
+ Examples
902
+ --------
903
+ >>> import numpy as np
904
+ >>> from sklearn.base import BaseEstimator, BiclusterMixin
905
+ >>> class DummyBiClustering(BiclusterMixin, BaseEstimator):
906
+ ... def fit(self, X, y=None):
907
+ ... self.rows_ = np.ones(shape=(1, X.shape[0]), dtype=bool)
908
+ ... self.columns_ = np.ones(shape=(1, X.shape[1]), dtype=bool)
909
+ ... return self
910
+ >>> X = np.array([[1, 1], [2, 1], [1, 0],
911
+ ... [4, 7], [3, 5], [3, 6]])
912
+ >>> bicluster = DummyBiClustering().fit(X)
913
+ >>> hasattr(bicluster, "biclusters_")
914
+ True
915
+ >>> bicluster.get_indices(0)
916
+ (array([0, 1, 2, 3, 4, 5]), array([0, 1]))
917
+ """
893
918
894
919
@property
895
920
def biclusters_ (self ):
0 commit comments