MODULE REFERENCE

metrics

anomx.metrics

Metrics

Regression Metrics

For deterministic forecasts (point predictions with num_samples == 1), probabilistic forecasts (num_samples > 1), and quantile forecasts. For probabilistic and quantile forecasts, use parameter q to define the quantile(s) to compute the deterministic metrics on:

  • Aggregated over time: Absolute metrics: - MERR: Mean Error - MAE: Mean Absolute Error - MSE: Mean Squared Error - RMSE: Root Mean Squared Error - RMSLE: Root Mean Squared Log Error
Relative metrics:
    - :func:`MASE <anomx.metrics.metrics.mase>`: Mean Absolute Scaled Error
    - :func:`MSSE <anomx.metrics.metrics.msse>`: Mean Squared Scaled Error
    - :func:`RMSSE <anomx.metrics.metrics.rmsse>`: Root Mean Squared Scaled Error
    - :func:`MAPE <anomx.metrics.metrics.mape>`: Mean Absolute Percentage Error
    - :func:`wMAPE <anomx.metrics.metrics.wmape>`: weighted Mean Absolute Percentage Error
    - :func:`sMAPE <anomx.metrics.metrics.smape>`: symmetric Mean Absolute Percentage Error
    - :func:`OPE <anomx.metrics.metrics.ope>`: Overall Percentage Error
    - :func:`MARRE <anomx.metrics.metrics.marre>`: Mean Absolute Ranged Relative Error
Other metrics:
    - :func:`R2 <anomx.metrics.metrics.r2_score>`: Coefficient of Determination
    - :func:`CV <anomx.metrics.metrics.coefficient_of_variation>`: Coefficient of Variation
    - :func:`AUTC <anomx.metrics.metrics.autc>`: Area Under Tolerance Curve
  • Per time step: Absolute metrics: - ERR: Error - AE: Absolute Error - SE: Squared Error - SLE: Squared Log Error
Relative metrics:
    - :func:`ASE <anomx.metrics.metrics.ase>`: Absolute Scaled Error
    - :func:`SSE <anomx.metrics.metrics.sse>`: Squared Scaled Error
    - :func:`APE <anomx.metrics.metrics.ape>`: Absolute Percentage Error
    - :func:`sAPE <anomx.metrics.metrics.sape>`: symmetric Absolute Percentage Error
    - :func:`ARRE <anomx.metrics.metrics.arre>`: Absolute Ranged Relative Error

For probabilistic forecasts (storchastic predictions with num_samples >> 1) and quantile forecasts:

  • Aggregated over time: Probabilistic metrics: - MCRPS: Mean Continuous Ranked Probability Score
Quantile metrics:
    - :func:`MQL <anomx.metrics.metrics.mql>`: Mean Quantile Loss
    - :func:`QR <anomx.metrics.metrics.qr>`: Quantile Risk
Quantile interval metrics:
    - :func:`MIW <anomx.metrics.metrics.miw>`: Mean Interval Width
    - :func:`MWS <anomx.metrics.metrics.miws>`: Mean Interval Winkler Score
    - :func:`MIC <anomx.metrics.metrics.mic>`: Mean Interval Coverage
    - :func:`MINCS_QR <anomx.metrics.metrics.mincs_qr>`: Mean Interval Non-Conformity Score for Quantile Regression
  • Per time step: Probabilistic metrics: - CRPS: Continuous Ranked Probability Score
Quantile metrics:
    - :func:`QL <anomx.metrics.metrics.ql>`: Quantile Loss
Quantile interval metrics:
    - :func:`IW <anomx.metrics.metrics.iw>`: Interval Width
    - :func:`WS <anomx.metrics.metrics.iws>`: Interval Winkler Score
    - :func:`IC <anomx.metrics.metrics.ic>`: Interval Coverage
    - :func:`INCS_QR <anomx.metrics.metrics.incs_qr>`: Interval Non-Conformity Score for Quantile Regression

Classification Metrics

For deterministic forecasts (point predictions with num_samples == 1), probabilistic forecasts (num_samples > 1), and class label probability forecasts. Most metrics allow to extract the scores for specific labels with parameter labels.

  • Aggregated over time: - Accuracy: Accuracy Score - Precision: Precision Score - Recall: Recall Score - F1: F1 Score - CM: Confusion Matrix

Dynamic Time Warping Metrics

For Dynamic Time Warping (DTW) (aggregated over time):

  • DTW: Dynamic Time Warping Metric

Public exports

Import these names directly from anomx.metrics.

accuracy

Accuracy Score [1]_.

ae

Absolute Error (AE).

ape

Absolute Percentage Error (APE).

arre

Absolute Ranged Relative Error (ARRE).

ase

Absolute Scaled Error (ASE) (see [1]_ for more information on scaled forecasting errors).

autc

Area Under Tolerance Curve (AUTC).

coefficient_of_variation

Coefficient of Variation (percentage).

confusion_matrix

Confusion Matrix (CM) [1]_.

crps

Continuous Ranked Probability Score (CRPS).

dtw_metric

Applies Dynamic Time Warping to `actual_series` and `pred_series` before passing it into the metric. Enables comparison between series of different lengths, phases and time indices.

err

Error (ERR).

f1

F1 Score [1]_.

ic

Interval Coverage (IC).

incs_qr

Interval Non-Conformity Score for Quantile Regression (INCS_QR).

iw

Interval Width (IW).

iws

Interval Winkler Score (IWS) [1]_.

mae

Mean Absolute Error (MAE).

mape

Mean Absolute Percentage Error (MAPE).

marre

Mean Absolute Ranged Relative Error (MARRE).

mase

Mean Absolute Scaled Error (MASE) (see [1]_ for more information on scaled forecasting errors).

mcrps

Mean Continuous Ranked Probability Score (MCRPS).

merr

Mean Error (MERR).

mic

Mean Interval Coverage (MIC).

mincs_qr

Mean Interval Non-Conformity Score for Quantile Regression (MINCS_QR).

miw

Mean Interval Width (MIW).

miws

Mean Interval Winkler Score (IWS) [1]_.

mql

Mean Quantile Loss (MQL).

mse

Mean Squared Error (MSE).

msse

Mean Squared Scaled Error (MSSE) (see [1]_ for more information on scaled forecasting errors).

ope

Overall Percentage Error (OPE).

plot_tolerance_curve

Plots the Tolerance Curve for evaluating forecast alignment.

precision

Precision Score [1]_.

ql

Quantile Loss (QL).

qr

Quantile Risk (QR)

r2_score

Coefficient of Determination :math:`R^2` (see [1]_ for more details).

recall

Recall Score [1]_.

rmse

Root Mean Squared Error (RMSE).

rmsle

Root Mean Squared Log Error (RMSLE).

rmsse

Root Mean Squared Scaled Error (RMSSE) (see [1]_ for more information on scaled forecasting errors).

sape

symmetric Absolute Percentage Error (sAPE).

se

Squared Error (SE).

sle

Squared Log Error (SLE).

smape

symmetric Mean Absolute Percentage Error (sMAPE).

sse

Squared Scaled Error (SSE) (see [1]_ for more information on scaled forecasting errors).

wmape

Weighted Mean Absolute Percentage Error (WMAPE). (see [1]_ for more information).

CLASSIFICATION_METRICS

CLASSIFICATION_METRICS

TIME_DEPENDENT_METRICS

TIME_DEPENDENT_METRICS