model_selection.GroupKFold()

sklearn.model_selection.GroupKFold

class sklearn.model_selection.GroupKFold(n_splits=3) [source]

K-fold iterator variant with non-overlapping groups.

The same group will not appear in two different folds (the number of distinct groups has to be at least equal to the number of folds).

The folds are approximately balanced in the sense that the number of distinct groups is approximately the same in each fold.

Parameters:

登录查看完整内容