Skip to content

metric

OfflineMetric

Bases: ABC

Base class for metrics.

name: str property

Return the name of the metric.

Returns:

Type Description
str

The name of the metric.

__call__(true, predicted) abstractmethod

Calculate the metric value for given true and predicted labels.

Parameters:

Name Type Description Default
true DataFrame

True labels

required
predicted DataFrame

Predicted labels

required

Returns:

Type Description
Any

Metric value

Source code in src/flowcean/core/metric.py
19
20
21
22
23
24
25
26
27
28
29
@abstractmethod
def __call__(self, true: pl.DataFrame, predicted: pl.DataFrame) -> Any:
    """Calculate the metric value for given true and predicted labels.

    Args:
        true: True labels
        predicted: Predicted labels

    Returns:
        Metric value
    """