Skip to content

Commit 783d72f

Browse files
authored
DOC: make it explicit that groups is used to perform the split in GridSearch CV (scikit-learn#29939)
1 parent e92dd40 commit 783d72f

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

sklearn/model_selection/_search.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -906,9 +906,13 @@ def fit(self, X, y=None, **params):
906906
and the CV splitter.
907907
908908
If a fit parameter is an array-like whose length is equal to
909-
`num_samples` then it will be split across CV groups along with `X`
910-
and `y`. For example, the :term:`sample_weight` parameter is split
911-
because `len(sample_weights) = len(X)`.
909+
`num_samples` then it will be split by cross-validation along with
910+
`X` and `y`. For example, the :term:`sample_weight` parameter is
911+
split because `len(sample_weights) = len(X)`. However, this behavior
912+
does not apply to `groups` which is passed to the splitter configured
913+
via the `cv` parameter of the constructor. Thus, `groups` is used
914+
*to perform the split* and determines which samples are
915+
assigned to the each side of the a split.
912916
913917
Returns
914918
-------

0 commit comments

Comments
 (0)