8000 DOC Improve doc for GroupKFold and StratifiedGroupKFold (#23948) · kasmith11/scikit-learn@e76fbcf · GitHub
[go: up one dir, main page]

Skip to content

Commit e76fbcf

Browse files
Timmatejjerphan
andauthored
DOC Im 8000 prove doc for GroupKFold and StratifiedGroupKFold (scikit-learn#23948)
Co-authored-by: Julien Jerphanion <git@jjerphan.xyz>
1 parent 3a9e708 commit e76fbcf

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

sklearn/model_selection/_split.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -452,8 +452,8 @@ def _iter_test_indices(self, X, y=None, groups=None):
452452
class GroupKFold(_BaseKFold):
453453
8000 """K-fold iterator variant with non-overlapping groups.
454454
455-
The same group will not appear in two different folds (the number of
456-
distinct groups has to be at least equal to the number of folds).
455+
Each group will appear exactly once in the test set across all folds (the
456+
number of distinct groups has to be at least equal to the number of folds).
457457
458458
The folds are approximately balanced in the sense that the number of
459459
distinct groups is approximately the same in each fold.
@@ -762,10 +762,11 @@ class StratifiedGroupKFold(_BaseKFold):
762762
return stratified folds with non-overlapping groups. The folds are made by
763763
preserving the percentage of samples for each class.
764764
765-
The same group will not appear in two different folds (the number of
766-
distinct groups has to be at least equal to the number of folds).
765+
Each group will appear exactly once in the test set across all folds (the
766+
number of distinct groups has to be at least equal to the number of folds).
767767
768-
The difference between GroupKFold and StratifiedGroupKFold is that
768+
The difference between :class:`~sklearn.model_selection.GroupKFold`
769+
and :class:`~sklearn.model_selection.StratifiedGroupKFold` is that
769770
the former attempts to create balanced folds such that the number of
770771
distinct grou 3CF7 ps is approximately the same in each fold, whereas
771772
StratifiedGroupKFold attempts to create folds which preserve the

0 commit comments

Comments
 (0)
0