From ecd20eeb0f3f5ab469837d0302f62709fc9470d7 Mon Sep 17 00:00:00 2001 From: adrinjalali Date: Tue, 14 Mar 2023 14:18:29 +0100 Subject: [PATCH] MNT change release version to 2.0 --- sklearn/exceptions.py | 2 +- sklearn/metrics/_scorer.py | 12 ++++++------ sklearn/model_selection/_split.py | 20 ++++++++++---------- sklearn/multioutput.py | 6 +++--- sklearn/utils/_metadata_requests.py | 20 ++++++++++---------- 5 files changed, 30 insertions(+), 30 deletions(-) diff --git a/sklearn/exceptions.py b/sklearn/exceptions.py index b9d497c51d8f1..3078be1cd7501 100644 --- a/sklearn/exceptions.py +++ b/sklearn/exceptions.py @@ -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 ---------- diff --git a/sklearn/metrics/_scorer.py b/sklearn/metrics/_scorer.py index 04baaf8859080..1626cbebdf714 100644 --- a/sklearn/metrics/_scorer.py +++ b/sklearn/metrics/_scorer.py @@ -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 ------- @@ -284,7 +284,7 @@ def set_score_request(self, **kwargs): Please see :ref:`User Guide ` on how the routing mechanism works. - .. versionadded:: 1.2 + .. versionadded:: 2.0 Parameters ---------- @@ -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 ------- @@ -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 ------- @@ -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 ------- @@ -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 ------- diff --git a/sklearn/model_selection/_split.py b/sklearn/model_selection/_split.py index a52c15eb129eb..2a8c2106c96b2 100644 --- a/sklearn/model_selection/_split.py +++ b/sklearn/model_selection/_split.py @@ -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} @@ -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} @@ -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 @@ -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 @@ -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 @@ -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 @@ -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} @@ -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} @@ -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 diff --git a/sklearn/multioutput.py b/sklearn/multioutput.py index b09debf6b50b3..22034f7b8a58a 100644 --- a/sklearn/multioutput.py +++ b/sklearn/multioutput.py @@ -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 ------- @@ -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 ------- @@ -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 ------- diff --git a/sklearn/utils/_metadata_requests.py b/sklearn/utils/_metadata_requests.py index 297c08c8c621b..82a524596b5e2 100644 --- a/sklearn/utils/_metadata_requests.py +++ b/sklearn/utils/_metadata_requests.py @@ -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 @@ -120,7 +120,7 @@ def is_valid(cls, item): Please see :ref:`User Guide ` on how the routing mechanism works. - .. versionadded:: 1.2 + .. versionadded:: 2.0 Parameters ---------- @@ -160,7 +160,7 @@ class MethodMetadataRequest: Refer to :class:`MetadataRequest` for how this class is used. - .. versionadded:: 1.2 + .. versionadded:: 2.0 Parameters ---------- @@ -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 ---------- @@ -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): @@ -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 ---------- @@ -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 ---------- @@ -1038,7 +1038,7 @@ class RequestMethod: """ A descriptor for request methods. - .. versionadded:: 1.2 + .. versionadded:: 2.0 Parameters ---------- @@ -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): @@ -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 ----------