mlrl.testbed.experiments.output.data module

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

Provides classes for representing output data.

class mlrl.testbed.experiments.output.data.DatasetOutputData(properties: Properties, context: Context = Context(include_dataset_type=True, include_prediction_scope=True, include_fold=True))

Bases: TextualOutputData, ABC

An abstract base class for all classes that represent output data that can be converted into a textual representation, as well as a dataset.

abstractmethod to_dataset(options: Options, **kwargs) Any | None

Creates and returns a dataset from the object.

Parameters:

options – Options to be taken into account

Returns:

The dataset

class mlrl.testbed.experiments.output.data.ObjectOutputData(properties: Properties, context: Context = Context(include_dataset_type=True, include_prediction_scope=True, include_fold=True))

Bases: OutputData, ABC

An abstract base class for all classes that represent output data that can be converted into a Python object.

abstractmethod to_object(options: Options, **kwargs) Any | None

Returns an object.

Parameters:

options – Options to be taken into account

Returns:

The object

class mlrl.testbed.experiments.output.data.OutputData(properties: Properties, context: Context = Context(include_dataset_type=True, include_prediction_scope=True, include_fold=True))

Bases: ABC

An abstract class for all classes that represent output data.

class Properties(name: str, file_name: str)

Bases: object

Properties of output data.

Attributes:

name: A name to be included in log messages file_name: A file name to be used for writing into output files

file_name: str
name: str
get_context(lookup_type: Type) Context

Returns a Context that can be used for finding a suitable sink for handling this data.

Parameters:

lookup_type – The type of the sink to search for

Returns:

A Context

class mlrl.testbed.experiments.output.data.OutputValue(option_key: str, name: str, percentage: bool = False)

Bases: object

Represents a numeric value that is part of output data.

static filter_values(values: Iterable[OutputValue], options: Options) List[OutputValue]

Allows to filter given output values based on given options.

Parameters:
  • values – The output values to be filtered

  • options – Options that should be used for filtering

Returns:

A list that contains the filtered output values

format(value, **kwargs) str

Creates and returns a textual representation of a given value.

Parameters:

value – The value

Returns:

The textual representation that has been created

class mlrl.testbed.experiments.output.data.TabularOutputData(properties: Properties, context: Context = Context(include_dataset_type=True, include_prediction_scope=True, include_fold=True))

Bases: TextualOutputData, ABC

An abstract class for all classes that represent output data that can be converted into a textual, as well as a tabular, representation.

abstractmethod to_table(options: Options, **kwargs) Table | None

Creates and returns a tabular representation of the object.

Parameters:

options – Options to be taken into account

Returns:

The tabular representation that has been created

class mlrl.testbed.experiments.output.data.TextualOutputData(properties: Properties, context: Context = Context(include_dataset_type=True, include_prediction_scope=True, include_fold=True))

Bases: OutputData, ABC

An abstract class for all classes that represent output data that can be converted into a textual representation.

class Title(title: str, context: Context)

Bases: object

A title that is printed before textual output data.

format(state: ExperimentState) str

Formats and returns the title that is printed before the output data.

Parameters:

state – The state from which the output data has been generated

abstractmethod to_text(options: Options, **kwargs) str | None

Creates and returns a textual representation of the object.

Parameters:

options – Options to be taken into account

Returns:

The textual representation that has been created