mlrl.testbed.experiments.fold module¶
Author: Michael Rapp (michael.rapp.ml@gmail.com)
Provides classes for representing folds of a dataset.
- class mlrl.testbed.experiments.fold.Fold(index: int)¶
Bases:
objectRepresents an individual fold of a dataset, i.e., a specific subset of the examples that are contained in the dataset.
- Attributes:
index: The index of the fold
- class mlrl.testbed.experiments.fold.FoldingStrategy(num_folds: int, first: int, last: int)¶
Bases:
objectRepresents a strategy for folding a dataset, i.e., for creating different subsets of the examples that are contained in the dataset.
- Attributes:
num_folds: The total number of folds first: The index of the first fold to be created (inclusive) last: The index of the last fold to be created (exclusive)
- property folds: Generator[Fold, None, None]¶
Returns a generator that generates all folds that are created by the strategy.
- Returns:
The generator
- is_last_fold(fold: Fold) bool¶
Returns whether a given fold is the last fold.
- Parameters:
fold – The fold to be checked
- Returns:
True, if the given fold is the last fold, False otherwise
- property is_subset¶
True, if only a subset of the folds is actually created, False otherwise.