Skip to content

MNT SLEP006: change release version to 2.0 #25851

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

Merged
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion sklearn/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class UnsetMetadataPassedError(ValueError):
"""Exception class to raise if a metadata is passed which is not explicitly \
requested.

.. versionadded:: 1.2
.. versionadded:: 2.0

Parameters
----------
Expand Down
12 changes: 6 additions & 6 deletions sklearn/metrics/_scorer.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ def __call__(self, estimator, X, y_true, **kwargs):
Other parameters passed to the scorer, e.g. sample_weight.
Refer to :func:`set_score_request` for more details.

.. versionadded:: 1.2
.. versionadded:: 2.0

Returns
-------
Expand Down Expand Up @@ -284,7 +284,7 @@ def set_score_request(self, **kwargs):
Please see :ref:`User Guide <metadata_routing>` on how the routing
mechanism works.

.. versionadded:: 1.2
.. versionadded:: 2.0

Parameters
----------
Expand Down Expand Up @@ -332,7 +332,7 @@ def _score(self, method_caller, estimator, X, y_true, **kwargs):
Other parameters passed to the scorer, e.g. sample_weight.
Refer to :func:`set_score_request` for more details.

.. versionadded:: 1.2
.. versionadded:: 2.0

Returns
-------
Expand Down Expand Up @@ -377,7 +377,7 @@ def _score(self, method_caller, clf, X, y, **kwargs):
Other parameters passed to the scorer, e.g. sample_weight.
Refer to :func:`set_score_request` for more details.

.. versionadded:: 1.2
.. versionadded:: 2.0

Returns
-------
Expand Down Expand Up @@ -441,7 +441,7 @@ def _score(self, method_caller, clf, X, y, **kwargs):
Other parameters passed to the scorer, e.g. sample_weight.
Refer to :func:`set_score_request` for more details.

.. versionadded:: 1.2
.. versionadded:: 2.0

Returns
-------
Expand Down Expand Up @@ -552,7 +552,7 @@ def __call__(self, estimator, *args, **kwargs):
def get_metadata_routing(self):
"""Get requested data properties.

.. versionadded:: 1.2
.. versionadded:: 2.0

Returns
-------
Expand Down
20 changes: 10 additions & 10 deletions sklearn/model_selection/_split.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,13 @@
]


class GroupsComsumerMixin(_MetadataRequester):
class GroupsConsumerMixin(_MetadataRequester):
"""A Mixin to ``groups`` by default.

This Mixin makes the object to request ``groups`` by default as
``REQUESTED``.

.. versionadded:: 1.2
.. versionadded:: 2.0
"""

__metadata_request__split = {"groups": RequestType.REQUESTED}
Expand All @@ -72,7 +72,7 @@ class BaseCrossValidator(_MetadataRequester, metaclass=ABCMeta):
"""

# This indicates that by default CV splitters don't have a "groups" kwarg,
# unless indicated by inheriting from ``GroupsComsumerMixin``.
# unless indicated by inheriting from ``GroupsConsumerMixin``.
# This also prevents ``set_split_request`` to be generated for splitters
# which don't support ``groups``.
__metadata_request__split = {"groups": RequestType.UNUSED}
Expand Down Expand Up @@ -487,7 +487,7 @@ def _iter_test_indices(self, X, y=None, groups=None):
current = stop


class GroupKFold(GroupsComsumerMixin, _BaseKFold):
class GroupKFold(GroupsConsumerMixin, _BaseKFold):
"""K-fold iterator variant with non-overlapping groups.

Each group will appear exactly once in the test set across all folds (the
Expand Down Expand Up @@ -793,7 +793,7 @@ def split(self, X, y, groups=None):
return super().split(X, y, groups)


class StratifiedGroupKFold(GroupsComsumerMixin, _BaseKFold):
class StratifiedGroupKFold(GroupsConsumerMixin, _BaseKFold):
"""Stratified K-Folds iterator variant with non-overlapping groups.

This cross-validation object is a variation of StratifiedKFold attempts to
Expand Down Expand Up @@ -1174,7 +1174,7 @@ def split(self, X, y=None, groups=None):
)


class LeaveOneGroupOut(GroupsComsumerMixin, BaseCrossValidator):
class LeaveOneGroupOut(GroupsConsumerMixin, BaseCrossValidator):
"""Leave One Group Out cross-validator

Provides train/test indices to split data such that each training set is
Expand Down Expand Up @@ -1293,7 +1293,7 @@ def split(self, X, y=None, groups=None):
return super().split(X, y, groups)


class LeavePGroupsOut(GroupsComsumerMixin, BaseCrossValidator):
class LeavePGroupsOut(GroupsConsumerMixin, BaseCrossValidator):
"""Leave P Group(s) Out cross-validator

Provides train/test indices to split data according to a third-party
Expand Down Expand Up @@ -1451,7 +1451,7 @@ class _RepeatedSplits(_MetadataRequester, metaclass=ABCMeta):
"""

# This indicates that by default CV splitters don't have a "groups" kwarg,
# unless indicated by inheriting from ``GroupsComsumerMixin``.
# unless indicated by inheriting from ``GroupsConsumerMixin``.
# This also prevents ``set_split_request`` to be generated for splitters
# which don't support ``groups``.
__metadata_request__split = {"groups": RequestType.UNUSED}
Expand Down Expand Up @@ -1674,7 +1674,7 @@ class BaseShuffleSplit(_MetadataRequester, metaclass=ABCMeta):
"""Base class for ShuffleSplit and StratifiedShuffleSplit"""

# This indicates that by default CV splitters don't have a "groups" kwarg,
# unless indicated by inheriting from ``GroupsComsumerMixin``.
# unless indicated by inheriting from ``GroupsConsumerMixin``.
# This also prevents ``set_split_request`` to be generated for splitters
# which don't support ``groups``.
__metadata_request__split = {"groups": RequestType.UNUSED}
Expand Down Expand Up @@ -1868,7 +1868,7 @@ def _iter_indices(self, X, y=None, groups=None):
yield ind_train, ind_test


class GroupShuffleSplit(GroupsComsumerMixin, ShuffleSplit):
class GroupShuffleSplit(GroupsConsumerMixin, ShuffleSplit):
"""Shuffle-Group(s)-Out cross-validation iterator

Provides randomized train/test indices to split data according to a
Expand Down
6 changes: 3 additions & 3 deletions sklearn/multioutput.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ def partial_fit(self, X, y, classes=None, sample_weight=None, **partial_fit_para
**partial_fit_params : dict of str -> object
Parameters passed to the ``estimator.partial_fit`` method of each step.

.. versionadded:: 1.2
.. versionadded:: 2.0

Returns
-------
Expand Down Expand Up @@ -377,7 +377,7 @@ def partial_fit(self, X, y, sample_weight=None, **partial_fit_params):
**partial_fit_params : dict of str -> object
Parameters passed to the ``estimator.partial_fit`` method of each step.

.. versionadded:: 1.2
.. versionadded:: 2.0

Returns
-------
Expand Down Expand Up @@ -851,7 +851,7 @@ def fit(self, X, Y, **fit_params):
**fit_params : dict of string -> object
Parameters passed to the `fit` method of each step.

.. versionadded:: 1.2
.. versionadded:: 2.0

Returns
-------
Expand Down
20 changes: 10 additions & 10 deletions sklearn/utils/_metadata_requests.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
class RequestType(Enum):
"""A metadata is requested either with a string alias or this enum.

.. versionadded:: 1.2
.. versionadded:: 2.0
"""

# Metadata is not requested. It will not be routed to the object having the
Expand Down Expand Up @@ -120,7 +120,7 @@ def is_valid(cls, item):
Please see :ref:`User Guide <metadata_routing>` on how the routing
mechanism works.

.. versionadded:: 1.2
.. versionadded:: 2.0

Parameters
----------
Expand Down Expand Up @@ -160,7 +160,7 @@ class MethodMetadataRequest:

Refer to :class:`MetadataRequest` for how this class is used.

.. versionadded:: 1.2
.. versionadded:: 2.0

Parameters
----------
Expand Down Expand Up @@ -352,7 +352,7 @@ class MetadataRequest:
Consumer-only classes such as simple estimators return a serialized
version of this class as the output of `get_metadata_routing()`.

.. versionadded:: 1.2
.. versionadded:: 2.0

Parameters
----------
Expand Down Expand Up @@ -472,7 +472,7 @@ class MethodMapping:
Iterating through an instance of this class will yield named
``MethodPair(callee, caller)`` tuples.

.. versionadded:: 1.2
.. versionadded:: 2.0
"""

def __init__(self):
Expand Down Expand Up @@ -569,7 +569,7 @@ class MetadataRouter:
:class:`~utils.metadata_requests.MetadataRequest` or a
:class:`~utils.metadata_requests.MetadataRouter` instance.

.. versionadded:: 1.2
.. versionadded:: 2.0

Parameters
----------
Expand Down Expand Up @@ -1000,7 +1000,7 @@ def get_routing_for_object(obj=None):
intput, such that changing the output of this function will not change the
original object.

.. versionadded:: 1.2
.. versionadded:: 2.0

Parameters
----------
Expand Down Expand Up @@ -1038,7 +1038,7 @@ class RequestMethod:
"""
A descriptor for request methods.

.. versionadded:: 1.2
.. versionadded:: 2.0

Parameters
----------
Expand Down Expand Up @@ -1133,7 +1133,7 @@ def func(**kw):
class _MetadataRequester:
"""Mixin class for adding metadata request functionality.

.. versionadded:: 1.2
.. versionadded:: 2.0
"""

def __init_subclass__(cls, **kwargs):
Expand Down Expand Up @@ -1305,7 +1305,7 @@ def process_routing(obj, method, other_params, **kwargs):
a call to this function would be:
``process_routing(self, fit_params, sample_weight=sample_weight)``.

.. versionadded:: 1.2
.. versionadded:: 2.0

Parameters
----------
Expand Down