ProbaMetric

class dtaianomaly.evaluation.ProbaMetric[source]

Base class for probabilistic metrics.

A class to indicate that a metric is probabilistic, i.e., that it computes a performance based on the continuous anomaly scores. This is mainly useful to differentiate with binary metrics.

compute(y_true: ndarray, y_pred: ndarray, **kwargs) float

Compute the performance score.

Evaluate how closely the given anomaly scores align to the ground truth anomaly scores.

Parameters:
y_truearray-like of shape (n_samples)

Ground-truth labels.

y_predarray-like of shape (n_samples)

Predicted anomaly scores.

**kwargs

Additional arguments used for computing the evaluation metric.

Returns:
float

The alignment score of the given ground truth and prediction, according to this score.

Raises:
ValueError

When inputs are not numeric “array-like”s

ValueError

If shapes of y_true and y_pred are not of identical shape

ValueError

If y_true is non-binary.