mlrl.testbed.predictions module

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

Provides classes for printing the predictions of a model. The predictions can be written to one or several outputs, e.g., to the console or to a file.

class mlrl.testbed.predictions.PredictionWriter(sinks: List[Sink])

Bases: OutputWriter

Allows to write predictions and corresponding ground truth labels to one or several sinks.

class ArffSink(output_dir: str, options: ~mlrl.common.options.Options = <mlrl.common.options.Options object>)

Bases: Sink

Allows to write predictions and corresponding ground truth labels to ARFF files.

write_output(meta_data: MetaData, data_split: DataSplit, data_type: DataType | None, prediction_scope: PredictionScope | None, output_data, **_)

See mlrl.testbed.output_writer.OutputWriter.Sink.write_output()

class LogSink(options: ~mlrl.common.options.Options = <mlrl.common.options.Options object>)

Bases: LogSink

Allows to write predictions and corresponding ground truth labels to the console.

class Predictions(predictions, ground_truth)

Bases: Formattable

Stores predictions and corresponding ground truth labels.

format(options: Options, **_) str

See mlrl.testbed.output_writer.Formattable.format()