A cuML pipeline is trained on a highly imbalanced binary dataset where the minority class makes up roughly 8% of samples. A colleague suggests using standard k-fold cross-validation with k=5. What is the primary risk of this approach, and which alternative directly addresses it?
- AStandard k-fold shuffles rows before splitting, which corrupts temporal ordering in time-series data; stratified k-fold avoids shuffling altogether to maintain sequence integrity.
- BStandard k-fold may assign all minority samples to a single fold, causing some folds to have no positive examples; stratified k-fold preserves the class ratio in each fold to avoid this. Correct
- CStandard k-fold uses the same random seed across folds, causing data leakage between train and validation sets; stratified k-fold uses distinct seeds per fold to eliminate leakage.
- DStandard k-fold computes metrics only on the training folds, so minority-class performance is never evaluated; stratified k-fold explicitly evaluates each fold as a held-out test set.
Why A is wrong: Shuffling and temporal ordering are relevant concerns for time-series problems, not for the class-imbalance problem described. Stratified k-fold still shuffles rows but does so within each class stratum, so it does not solve a time-ordering concern.
Why B is correct: With severe imbalance, random partitioning can produce folds where the minority class is absent or dramatically under-represented, making fold-level metrics meaningless. Stratified k-fold samples each class proportionally into every fold, ensuring a consistent evaluation signal across all splits.
Why C is wrong: Data leakage is not a consequence of the random seed or fold structure in standard k-fold. Both standard and stratified k-fold maintain strict separation between train and validation partitions; seed choice does not introduce leakage.
Why D is wrong: In every k-fold variant, each fold takes a turn as the held-out validation set and metrics are computed on that held-out portion - not on the training folds. This is a misunderstanding of how k-fold evaluation works, not a real distinction between the two methods.