Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DOC add meaning of max_patches=None in _compute_n_patches #25999

Merged
merged 4 commits into from
Jun 26, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions sklearn/feature_extraction/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,7 @@ def _compute_n_patches(i_h, i_w, p_h, p_w, max_patches=None):
The maximum number of patches to extract. If max_patches is a float
between 0 and 1, it is taken to be a proportion of the total number
of patches.
If max_patches=None then the total number of patches will be extracted.
Ily83 marked this conversation as resolved.
Show resolved Hide resolved
"""
n_h = i_h - p_h + 1
n_w = i_w - p_w + 1
Expand Down Expand Up @@ -372,6 +373,8 @@ def extract_patches_2d(image, patch_size, *, max_patches=None, random_state=None
The maximum number of patches to extract. If `max_patches` is a float
between 0 and 1, it is taken to be a proportion of the total number
of patches.
If max_patches=None then the total number of patches will be extracted.

Ily83 marked this conversation as resolved.
Show resolved Hide resolved

random_state : int, RandomState instance, default=None
Determines the random number generator used for random sampling when
Expand Down