File tree 2 files changed +7
-9
lines changed
sklearn/model_selection/tests 2 files changed +7
-9
lines changed Original file line number Diff line number Diff line change @@ -182,6 +182,10 @@ Changelog
182
182
estimator without re-fitting it.
183
183
:pr: `29067 ` by :user: `Guillaume Lemaitre <glemaitre> `.
184
184
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
+
185
189
:mod: `sklearn.neighbors `
186
190
........................
187
191
Original file line number Diff line number Diff line change @@ -2061,18 +2061,12 @@ def test_Stratified_mandatory_y_argument():
2061
2061
# y = [0] * 90 + [1] * 10
2062
2062
# Variable 'y' is required for Stratified classes split function.
2063
2063
# Testing the split without 'y', shoudl raise TypeError.
2064
+ msg = r"split\(\) missing 1 required positional argument: 'y'"
2064
2065
2065
2066
cv = StratifiedKFold (n_splits = 2 )
2066
- msg = r".*StratifiedKFold\.split\(\) missing 1 required positional argument: 'y'.*"
2067
2067
with pytest .raises (TypeError , match = msg ):
2068
- for _i , (_train , _test ) in enumerate (cv .split (x )):
2069
- pass
2068
+ cv .split (x )
2070
2069
2071
2070
cv = RepeatedStratifiedKFold (n_splits = 2 , n_repeats = 3 )
2072
- msg = (
2073
- r".*RepeatedStratifiedKFold\.split\(\) "
2074
- r"missing 1 required positional argument: 'y'.*"
2075
- )
2076
2071
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