base.metrics.error_metric_factory module

class base.metrics.error_metric_factory.ErrorMetricFactory

Bases: object

Factory class for creating ErrorMetric instances.

Provides functionality to create ErrorMetric instances based on their unique class IDs and bound and step parameters.

SUPPORTED_ERROR_METRICS = {'BF': <function ErrorMetricFactory.<lambda>>, 'BM': <function ErrorMetricFactory.<lambda>>, 'WC': <function ErrorMetricFactory.<lambda>>}
static factory(metric_id, bound, step=0)

Creates an ErrorMetric instance of the type specified by metricId.

The object will be instantiated with the given bound and step parameters or default step value if step is not specified.

Parameters:
  • metric_id (str) – The unique ID string of the ErrorMetric subclass to instantiate.
  • bound (float) – The upper bound for the new ErrorMetric’s value.
  • step (float) – The rate at which the value is increased in each step. Default value is 0.
Returns:

An instance of the ErrorMetric subclass specified by metric_id.

Return type:

ErrorMetric