Skip to content
Quantoros

GroupKFold produces folds with different sample counts. Does that alone mean the split is incorrect?

Classic MLLevel: IntermediateGroup-size imbalance

GroupKFold produces folds with different sample counts. Does that alone mean the split is incorrect?

Hints
  • A large group cannot be split just for balance.
  • Equal group count need not mean equal row count.

Answer

No. Groups are indivisible and may have unequal sizes. Inspect both sample and group counts and choose aggregation reflecting whether rows or groups are the deployment unit.

Source and licence: scikit-learn 1.7.2 — cross validation · BSD-3-Clause · answer: Quantoros editorial

Related questions