Source: texcla/utils/sampling.py#L0


equal_distribution_folds

equal_distribution_folds(y, folds=2)

Creates folds number of indices that has roughly balanced multi-label distribution.

Args:

  • y: The multi-label outputs.
  • folds: The number of folds to create.

Returns:

folds number of indices that have roughly equal multi-label distributions.


multi_label_train_test_split

multi_label_train_test_split(y, test_size=0.2)

Creates a test split with roughly the same multi-label distribution in y.

Args:

  • y: The multi-label outputs.
  • test_size: The test size in [0, 1]

Returns:

The train and test indices.