8000 DOC Added the meanings of default=None for PatchExtractor parameters … · scikit-learn/scikit-learn@42d1cb4 · GitHub
[go: up one dir, main page]

Skip to content

Commit 42d1cb4

Browse files
authored
DOC Added the meanings of default=None for PatchExtractor parameters (#26005)
1 parent 644e167 commit 42d1cb4

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

sklearn/feature_extraction/image.py

+6-4
Original file line numberDiff line numberDiff line change
@@ -503,12 +503,14 @@ class PatchExtractor(TransformerMixin, BaseEstimator):
503503
Parameters
504504
----------
505505
patch_size : tuple of int (patch_height, patch_width), default=None
506-
The dimensions of one patch.
506+
The dimensions of one patch. If set to None, the patch size will be
507+
automatically set to `(img_height // 10, img_width // 10)`, where
508+
`img_height` and `img_width` are the dimensions of the input images.
507509
508510
max_patches : int or float, default=None
509511
The maximum number of patches per image to extract. If `max_patches` is
510512
a float in (0, 1), it is taken to mean a proportion of the total number
511-
of patches.
513+
of patches. If set to None, extract all possible patches.
512514
513515
random_state : int, RandomState instance, default=None
514516
Determines the random number generator used for random sampling when
@@ -618,8 +620,8 @@ def transform(self, X):
618620
else:
619621
if len(self.patch_size) != 2:
620622
raise ValueError(
621-
f"patch_size must be a tuple of two integers. Got {self.patch_size}"
622-
" instead."
623+
"patch_size must be a tuple of two integers. Got"
624+
f" {self.patch_size} instead."
623625
)
624626
patch_size = self.patch_size
625627

0 commit comments

Comments
 (0)
0