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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

MAINT Parameters validation for sklearn.utils.safe_mask #26131

Merged
merged 11 commits into from
Jun 27, 2023
Prev Previous commit
Next Next commit
modified validate-mask parameter value
  • Loading branch information
elabongaatuo committed Apr 14, 2023
commit 7b0a2b201db7afb8f47aee9e21820565511c6d03
8 changes: 8 additions & 0 deletions sklearn/utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -471,6 +471,14 @@ def _get_column_indices(X, key):
)


@validate_params(
{
"replace": ["boolean"],
"n_samples": [Interval(numbers.Integral, 1, None, closed="left"), None],
"random_state": ["random_state"],
"stratify": ["array-like", None],
}
)
def resample(*arrays, replace=True, n_samples=None, random_state=None, stratify=None):
"""Resample arrays or sparse matrices in a consistent way.

Expand Down