diff --git a/doc/modules/classes.rst b/doc/modules/classes.rst index b7b1c490777bd..2e54d000a13aa 100644 --- a/doc/modules/classes.rst +++ b/doc/modules/classes.rst @@ -433,14 +433,12 @@ Samples generator :toctree: generated/ :template: class.rst - exceptions.ChangedBehaviorWarning exceptions.ConvergenceWarning exceptions.DataConversionWarning exceptions.DataDimensionalityWarning exceptions.EfficiencyWarning exceptions.FitFailedWarning exceptions.NotFittedError - exceptions.NonBLASDotWarning exceptions.UndefinedMetricWarning diff --git a/doc/whats_new/v0.24.rst b/doc/whats_new/v0.24.rst index dcc59a3339efa..9e31762d62c29 100644 --- a/doc/whats_new/v0.24.rst +++ b/doc/whats_new/v0.24.rst @@ -101,6 +101,13 @@ Changelog :pr:`17694` by :user:`Markus Rempfler ` and :user:`Tsutomu Kusanagi `. +:mod:`sklearn.exceptions` +......................... + +- |API| :class:`exceptions.ChangedBehaviorWarning` and + :class:`exceptions.NonBLASDotWarning` are deprecated and will be removed in + v0.26, :pr:`17804` by `Adrin Jalali`_. + :mod:`sklearn.feature_selection` ................................ diff --git a/sklearn/exceptions.py b/sklearn/exceptions.py index 7140b98e53027..3a3188be35468 100644 --- a/sklearn/exceptions.py +++ b/sklearn/exceptions.py @@ -3,6 +3,8 @@ classes used across scikit-learn. """ +from .utils.deprecation import deprecated + __all__ = ['NotFittedError', 'ChangedBehaviorWarning', 'ConvergenceWarning', @@ -38,6 +40,8 @@ class NotFittedError(ValueError, AttributeError): """ +@deprecated("ChangedBehaviorWarning is deprecated in 0.24 and will be removed " + "in 0.26") class ChangedBehaviorWarning(UserWarning): """Warning class used to notify the user of any change in the behavior. @@ -109,6 +113,8 @@ class FitFailedWarning(RuntimeWarning): """ +@deprecated("NonBLASDotWarning is deprecated in 0.24 and will be removed in " + "0.26") class NonBLASDotWarning(EfficiencyWarning): """Warning used when the dot operation does not use BLAS. diff --git a/sklearn/utils/validation.py b/sklearn/utils/validation.py index 454d7d1d4bba0..2e871af944758 100644 --- a/sklearn/utils/validation.py +++ b/sklearn/utils/validation.py @@ -25,16 +25,12 @@ from .fixes import _object_dtype_isnan, parse_version from .. import get_config as _get_config -from ..exceptions import NonBLASDotWarning, PositiveSpectrumWarning +from ..exceptions import PositiveSpectrumWarning from ..exceptions import NotFittedError from ..exceptions import DataConversionWarning FLOAT_DTYPES = (np.float64, np.float32, np.float16) -# Silenced by default to reduce verbosity. Turn on at runtime for -# performance profiling. -warnings.simplefilter('ignore', NonBLASDotWarning) - def _deprecate_positional_args(f): """Decorator for methods that issues warnings for positional arguments