mlrl.testbed.experiments.input.dataset.splitters.splitter module

Author: Michael Rapp (michael.rapp.ml@gmail.com)

Provides classes for implementing splitters that split datasets into training and test datasets.

class mlrl.testbed.experiments.input.dataset.splitters.splitter.DatasetSplitter(folding_strategy: FoldingStrategy)

Bases: ABC

An abstract base class for all classes that split a dataset into training and test data.

class Split

Bases: ABC

An abstract base class for all classes that represent a split of a dataset into training and test datasets.

abstractmethod get_state(dataset_type: DatasetType) ExperimentState | None

Returns a state that stores the dataset that corresponds to a specific DatasetType.

Parameters:

dataset_type – The DatasetType

Returns:

A state that stores the dataset that corresponds to the given DatasetType or None, if not such dataset is available

abstractmethod split(state: ExperimentState) Generator[Split, None, None]

Returns a generator that generates the individual splits of the dataset into training and test data.

Parameters:

state – The current state of the experiment

Returns:

The generator