diff --git a/maint_tools/test_docstrings.py b/maint_tools/test_docstrings.py index d4c30f327e73e..92cdfbd717406 100644 --- a/maint_tools/test_docstrings.py +++ b/maint_tools/test_docstrings.py @@ -22,7 +22,6 @@ "OrthogonalMatchingPursuitCV", "PassiveAggressiveClassifier", "PassiveAggressiveRegressor", - "PatchExtractor", "PolynomialFeatures", "QuadraticDiscriminantAnalysis", "SelfTrainingClassifier", diff --git a/sklearn/feature_extraction/image.py b/sklearn/feature_extraction/image.py index 7d71a2b5f2e32..b6fb19ff09d27 100644 --- a/sklearn/feature_extraction/image.py +++ b/sklearn/feature_extraction/image.py @@ -451,7 +451,7 @@ def reconstruct_from_patches_2d(patches, image_size): class PatchExtractor(BaseEstimator): - """Extracts patches from a collection of images + """Extracts patches from a collection of images. Read more in the :ref:`User Guide `. @@ -463,16 +463,20 @@ class PatchExtractor(BaseEstimator): The dimensions of one patch. max_patches : int or float, default=None - The maximum number of patches per image to extract. If max_patches is a - float in (0, 1), it is taken to mean a proportion of the total number + The maximum number of patches per image to extract. If `max_patches` is + a float in (0, 1), it is taken to mean a proportion of the total number of patches. random_state : int, RandomState instance, default=None Determines the random number generator used for random sampling when - `max_patches` is not None. Use an int to make the randomness + `max_patches is not None`. Use an int to make the randomness deterministic. See :term:`Glossary `. + See Also + -------- + reconstruct_from_patches_2d : Reconstruct image from all of its patches. + Examples -------- >>> from sklearn.datasets import load_sample_images @@ -503,11 +507,19 @@ def fit(self, X, y=None): ---------- X : array-like of shape (n_samples, n_features) Training data. + + y : Ignored + Not used, present for API consistency by convention. + + Returns + ------- + self : object + Returns the instance itself. """ return self def transform(self, X): - """Transforms the image samples in X into a matrix of patch data. + """Transform the image samples in `X` into a matrix of patch data. Parameters ----------