Concept icon
Concept

Hold out entire groups to evaluate generalization to unseen groups

When the evaluation target is prediction for unseen groups, every group represented in a validation fold must be absent from its paired training fold. In scikit-learn, GroupKFold implements this separation using sample group identifiers supplied through the groups parameter. This controls training–validation group overlap for that evaluation target.

Conditions and limits:

  • Predicting future observations from already represented groups is a different evaluation target.
  • The number of distinct groups must be at least the number of folds; each group appears in a test fold exactly once across the folds.
  • Group separation does not guarantee preserved class proportions, equal sample counts or chronological order.
  • Correct group identifiers are needed to enforce the intended separation.
  • Controlling group overlap does not establish that preprocessing, feature or target leakage has been eliminated.

Sources:

0

1

Concept icon
Updated 2026-10-11

Contributors are:

Who are from:

Tags

Machine Learning

Data Science

Dive into Deep Learning @ D2L

Deep Learning

Related