mlrl.testbed.prediction_scope module

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

Provides classes that provide information about predictions.

class mlrl.testbed.prediction_scope.GlobalPrediction

Bases: PredictionScope

Provides information about predictions that have been obtained from a global model.

get_file_name(name: str) str

Returns a file name that corresponds to a specific prediction scope.

Parameters:

name – The name of the file (without suffix)

Returns:

The file name

get_model_size() int

Returns the size of the model from which the prediction have been obtained.

Returns:

The size of the model or 0, if the predictions have been obtained from a global model

is_global() bool

Returns whether the predictions have been obtained from a global model or not.

Returns:

True, if the predictions have been obtained from a global model, False otherwise

class mlrl.testbed.prediction_scope.IncrementalPrediction(model_size: int)

Bases: PredictionScope

Provides information about predictions that have been obtained incrementally.

get_file_name(name: str) str

Returns a file name that corresponds to a specific prediction scope.

Parameters:

name – The name of the file (without suffix)

Returns:

The file name

get_model_size() int

Returns the size of the model from which the prediction have been obtained.

Returns:

The size of the model or 0, if the predictions have been obtained from a global model

is_global() bool

Returns whether the predictions have been obtained from a global model or not.

Returns:

True, if the predictions have been obtained from a global model, False otherwise

class mlrl.testbed.prediction_scope.PredictionScope

Bases: ABC

Provides information about whether predictions have been obtained from a global model or incrementally.

abstract get_file_name(name: str) str

Returns a file name that corresponds to a specific prediction scope.

Parameters:

name – The name of the file (without suffix)

Returns:

The file name

abstract get_model_size() int

Returns the size of the model from which the prediction have been obtained.

Returns:

The size of the model or 0, if the predictions have been obtained from a global model

abstract is_global() bool

Returns whether the predictions have been obtained from a global model or not.

Returns:

True, if the predictions have been obtained from a global model, False otherwise

class mlrl.testbed.prediction_scope.PredictionType(value, names=None, *values, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: Enum

Contains all possible types of predictions that may be obtained from a learner.

BINARY = 'binary'
PROBABILITIES = 'probabilities'
SCORES = 'scores'