8000 MAINT Parameters validation for sklearn.preprocessing.binarize (#26076) · scikit-learn/scikit-learn@19ed2a0 · GitHub
[go: up one dir, main page]

Skip to content

Commit 19ed2a0

Browse files
MAINT Parameters validation for sklearn.preprocessing.binarize (#26076)
1 parent fafdecb commit 19ed2a0

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

sklearn/preprocessing/_data.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2006,6 +2006,13 @@ def _more_tags(self):
20062006
return {"stateless": True}
20072007

20082008

2009+
@validate_params(
2010+
{
2011+
"X": ["array-like", "sparse matrix"],
2012+
"threshold": [Interval(Real, None, None, closed="neither")],
2013+
"copy": ["boolean"],
2014+
}
2015+
)
20092016
def binarize(X, *, threshold=0.0, copy=True):
20102017
"""Boolean thresholding of array-like or scipy.sparse matrix.
20112018

sklearn/tests/test_public_functions.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,7 @@ def _check_function_param_validation(
222222
"sklearn.metrics.zero_one_loss",
223223
"sklearn.model_selection.train_test_split",
224224
"sklearn.preprocessing.add_dummy_feature",
225+
"sklearn.preprocessing.binarize",
225226
"sklearn.preprocessing.scale",
226227
"sklearn.random_projection.johnson_lindenstrauss_min_dim",
227228
"sklearn.svm.l1_min_c",

0 commit comments

Comments
 (0)
0