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

MNT deprecate ChangedBehaviorWarning and NonBLASDotWarning #17804

Merged
merged 3 commits into from Jul 5, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 0 additions & 2 deletions doc/modules/classes.rst
Expand Up @@ -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


Expand Down
7 changes: 7 additions & 0 deletions doc/whats_new/v0.24.rst
Expand Up @@ -101,6 +101,13 @@ Changelog
:pr:`17694` by :user:`Markus Rempfler <rempfler>` and
:user:`Tsutomu Kusanagi <t-kusanagi2>`.

: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`
................................

Expand Down
6 changes: 6 additions & 0 deletions sklearn/exceptions.py
Expand Up @@ -3,6 +3,8 @@
classes used across scikit-learn.
"""

from .utils.deprecation import deprecated

__all__ = ['NotFittedError',
'ChangedBehaviorWarning',
'ConvergenceWarning',
Expand Down Expand Up @@ -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.

Expand Down Expand Up @@ -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.

Expand Down
6 changes: 1 addition & 5 deletions sklearn/utils/validation.py
Expand Up @@ -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
Expand Down