avocado.Dataset.label_folds

Dataset.label_folds(num_folds=None, random_state=None)

Separate the dataset into groups for k-folding

This is only applicable to training datasets that have assigned classes.

If the dataset is an augmented dataset, we ensure that the augmentations of the same object stay in the same fold.

Parameters:
  • num_folds (int (optional)) – The number of folds to use. Default: settings[‘num_folds’]
  • random_state (int (optional)) – The random number initializer to use for splitting the folds. Default: settings[‘fold_random_state’].
Returns:

fold_indices – A pandas Series where each element is an integer representing the assigned fold for each object.

Return type:

pandas.Series