File tree Expand file tree Collapse file tree 2 files changed +7
-9
lines changed
sklearn/model_selection/tests Expand file tree Collapse file tree 2 files changed +7
-9
lines changed Original file line number Diff line number Diff line change @@ -182,6 +182,10 @@ Changelog
182182 estimator without re-fitting it.
183183 :pr: `29067 ` by :user: `Guillaume Lemaitre <glemaitre> `.
184184
185+ - |Fix | :class: `model_selection.RepeatedStratifiedKFold ` has the function split,
186+ where 'y' parameter is made as mandatory input field.
187+ :pr: `29402 ` by :user: `Anurag Varma <Anurag-Varma> `.
188+
185189:mod: `sklearn.neighbors `
186190........................
187191
Original file line number Diff line number Diff line change @@ -2061,18 +2061,12 @@ def test_Stratified_mandatory_y_argument():
20612061 # y = [0] * 90 + [1] * 10
20622062 # Variable 'y' is required for Stratified classes split function.
20632063 # Testing the split without 'y', shoudl raise TypeError.
2064+ msg = r"split\(\) missing 1 required positional argument: 'y'"
20642065
20652066 cv = StratifiedKFold (n_splits = 2 )
2066- msg = r".*StratifiedKFold\.split\(\) missing 1 required positional argument: 'y'.*"
20672067 with pytest .raises (TypeError , match = msg ):
2068- for _i , (_train , _test ) in enumerate (cv .split (x )):
2069- pass
2068+ cv .split (x )
20702069
20712070 cv = RepeatedStratifiedKFold (n_splits = 2 , n_repeats = 3 )
2072- msg = (
2073- r".*RepeatedStratifiedKFold\.split\(\) "
2074- r"missing 1 required positional argument: 'y'.*"
2075- )
20762071 with pytest .raises (TypeError , match = msg ):
2077- for _i , (_train , _test ) in enumerate (cv .split (x )):
2078- pass
2072+ cv .split (x )
You can’t perform that action at this time.
0 commit comments