Implement Stratified K-Fold Cross Validation

Implement a Stratified K-Fold Cross Validation splitter.

Given:

  • A label array y of length n (labels can be ints or strings).
  • An integer k (number of folds, 2 <= k <= n).

Output k f...

Example

Unlock to view complete problem details

and practice with sample input/output

Was this article helpful?

View Test Cases & Run Code requires membership

Standard Input
Execution Result: