@@ -451,7 +451,7 @@ def reconstruct_from_patches_2d(patches, image_size):
451
451
452
452
453
453
class PatchExtractor (BaseEstimator ):
454
- """Extracts patches from a collection of images
454
+ """Extracts patches from a collection of images.
455
455
456
456
Read more in the :ref:`User Guide <image_feature_extraction>`.
457
457
@@ -463,16 +463,20 @@ class PatchExtractor(BaseEstimator):
463
463
The dimensions of one patch.
464
464
465
465
max_patches : int or float, default=None
466
- The maximum number of patches per image to extract. If max_patches is a
467
- float in (0, 1), it is taken to mean a proportion of the total number
466
+ The maximum number of patches per image to extract. If ` max_patches` is
467
+ a float in (0, 1), it is taken to mean a proportion of the total number
468
468
of patches.
469
469
470
470
random_state : int, RandomState instance, default=None
471
471
Determines the random number generator used for random sampling when
472
- `max_patches` is not None. Use an int to make the randomness
472
+ `max_patches is not None` . Use an int to make the randomness
473
473
8000
td> deterministic.
474
474
See :term:`Glossary <random_state>`.
475
475
476
+ See Also
477
+ --------
478
+ reconstruct_from_patches_2d : Reconstruct image from all of its patches.
479
+
476
480
Examples
477
481
--------
478
482
>>> from sklearn.datasets import load_sample_images
@@ -503,11 +507,19 @@ def fit(self, X, y=None):
503
507
----------
504
508
X : array-like of shape (n_samples, n_features)
505
509
Training data.
510
+
511
+ y : Ignored
512
+ Not used, present for API consistency by convention.
513
+
514
+ Returns
515
+ -------
516
+ self : object
517
+ Returns the instance itself.
506
518
"""
507
519
return self
508
520
509
521
def transform (self , X ):
510
- """Transforms the image samples in X into a matrix of patch data.
522
+ """Transform the image samples in `X` into a matrix of patch data.
511
523
512
524
Parameters
513
525
----------
0 commit comments