diff --git a/maint_tools/test_docstrings.py b/maint_tools/test_docstrings.py index e621ba12dcb11..03412b0bdc1c4 100644 --- a/maint_tools/test_docstrings.py +++ b/maint_tools/test_docstrings.py @@ -16,7 +16,6 @@ "BaggingRegressor", "BernoulliNB", "BernoulliRBM", - "Binarizer", "Birch", "CCA", "CalibratedClassifierCV", diff --git a/sklearn/preprocessing/_data.py b/sklearn/preprocessing/_data.py index d711c2c947a96..abaf5100936a6 100644 --- a/sklearn/preprocessing/_data.py +++ b/sklearn/preprocessing/_data.py @@ -2006,7 +2006,7 @@ class Binarizer(TransformerMixin, BaseEstimator): Threshold may not be less than 0 for operations on sparse matrices. copy : bool, default=True - set to False to perform inplace binarization and avoid a copy (if + Set to False to perform inplace binarization and avoid a copy (if the input is already a numpy array or a scipy.sparse CSR matrix). Attributes @@ -2016,6 +2016,20 @@ class Binarizer(TransformerMixin, BaseEstimator): .. versionadded:: 0.24 + See Also + -------- + binarize : Equivalent function without the estimator API. + KBinsDiscretizer : Bin continuous data into intervals. + OneHotEncoder : Encode categorical features as a one-hot numeric array. + + Notes + ----- + If the input is a sparse matrix, only the non-zero values are subject + to update by the Binarizer class. + + This estimator is stateless (besides constructor parameters), the + fit method does nothing but is useful when used in a pipeline. + Examples -------- >>> from sklearn.preprocessing import Binarizer @@ -2029,18 +2043,6 @@ class Binarizer(TransformerMixin, BaseEstimator): array([[1., 0., 1.], [1., 0., 0.], [0., 1., 0.]]) - - Notes - ----- - If the input is a sparse matrix, only the non-zero values are subject - to update by the Binarizer class. - - This estimator is stateless (besides constructor parameters), the - fit method does nothing but is useful when used in a pipeline. - - See Also - -------- - binarize : Equivalent function without the estimator API. """ def __init__(self, *, threshold=0.0, copy=True):