8000 MNT Replaced kwargs by named args for train_test_split (#17216) · jayzed82/scikit-learn@b886c8f · GitHub
[go: up one dir, main page]

Skip to content

Commit b886c8f

Browse files
hugolmnjayzed82
authored andcommitted
MNT Replaced kwargs by named args for train_test_split (scikit-learn#17216)
1 parent 2ba22fd commit b886c8f

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

sklearn/model_selection/_split.py

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2072,7 +2072,12 @@ def check_cv(cv=5, y=None, *, classifier=False):
20722072
return cv # New style cv objects are passed without any modification
20732073

20742074

2075-
def train_test_split(*arrays, **options):
2075+
def train_test_split(*arrays,
2076+
test_size=None,
2077+
train_size=None,
2078+
random_state=None,
2079+
shuffle=True,
2080+
stratify=None):
20762081
"""Split arrays or matrices into random train and test subsets
20772082
20782083
Quick utility that wraps input validation and
@@ -2161,14 +2166,6 @@ def train_test_split(*arrays, **options):
21612166
n_arrays = len(arrays)
21622167
if n_arrays == 0:
21632168
raise ValueError("At least one array required as input")
2164-
test_size = options.pop('test_size', None)
2165-
train_size = options.pop('train_size', None)
2166-
random_state = options.pop('random_state', None)
2167-
stratify = options.pop('stratify', None)
2168-
shuffle = options.pop('shuffle', True)
2169-
2170-
if options:
2171-
raise TypeError("Invalid parameters passed: %s" % str(options))
21722169

21732170
arrays = indexable(*arrays)
21742171

0 commit comments

Comments
 (0)
0