Performance metrics

The aeon.performance_metrics module contains metrics for evaluating and tuning time series models.

Metrics for assessing model performance.

Forecasting

mean_absolute_scaled_error(y_true, y_pred[, ...])

Mean absolute scaled error (MASE).

median_absolute_scaled_error(y_true, y_pred)

Median absolute scaled error (MdASE).

mean_squared_scaled_error(y_true, y_pred[, ...])

Mean squared scaled error (MSSE) or root mean squared scaled error (RMSSE).

median_squared_scaled_error(y_true, y_pred)

Median squared scaled error (MdSSE) or root median squared scaled error (RMdSSE).

mean_absolute_error(y_true, y_pred[, ...])

Mean absolute error (MAE).

mean_squared_error(y_true, y_pred[, ...])

Mean squared error (MSE) or root mean squared error (RMSE).

median_absolute_error(y_true, y_pred[, ...])

Median absolute error (MdAE).

median_squared_error(y_true, y_pred[, ...])

Median squared error (MdSE) or root median squared error (RMdSE).

geometric_mean_absolute_error(y_true, y_pred)

Geometric mean absolute error (GMAE).

geometric_mean_squared_error(y_true, y_pred)

Geometric mean squared error (GMSE) or Root geometric mean squared error (RGMSE).

mean_absolute_percentage_error(y_true, y_pred)

Mean absolute percentage error (MAPE) or symmetric version.

median_absolute_percentage_error(y_true, y_pred)

Median absolute percentage error (MdAPE) or symmetric version.

mean_squared_percentage_error(y_true, y_pred)

Mean squared percentage error (MSPE) or square root version.

median_squared_percentage_error(y_true, y_pred)

Median squared percentage error (MdSPE) or square root version.

mean_relative_absolute_error(y_true, y_pred)

Mean relative absolute error (MRAE).

median_relative_absolute_error(y_true, y_pred)

Median relative absolute error (MdRAE).

geometric_mean_relative_absolute_error(...)

Geometric mean relative absolute error (GMRAE).

geometric_mean_relative_squared_error(...[, ...])

Geometric mean relative squared error (GMRSE).

mean_asymmetric_error(y_true, y_pred[, ...])

Calculate mean of asymmetric loss function.

mean_linex_error(y_true, y_pred[, a, b, ...])

Calculate mean linex error.

relative_loss(y_true, y_pred[, ...])

Relative loss of forecast versus benchmark forecast for a given metric.

Segmentation

count_error(true_change_points, ...)

Error counting the difference in the number of change points.

hausdorff_error(true_change_points, ...[, ...])

Compute the Hausdorff distance between two sets of change points.

prediction_ratio(true_change_points, ...)

Prediction ratio is the ratio of number of predicted to true change points.

Anomaly Detection

range_precision(y_true, y_pred[, alpha, ...])

Compute the range-based precision metric.

range_recall(y_true, y_pred[, alpha, ...])

Compute the range-based recall metric.

range_f_score(y_true, y_pred[, beta, ...])

Compute the F-score using the range-based recall and precision metrics.

roc_auc_score(y_true, y_score)

Compute the ROC AUC score.

pr_auc_score(y_true, y_score)

Compute the precision-recall AUC score.

rp_rr_auc_score(y_true, y_score[, ...])

Compute the AUC-score of the range-based precision-recall curve.

f_score_at_k_points(y_true, y_score[, k])

Compute the F-score at k based on single points.

f_score_at_k_ranges(y_true, y_score[, k])

Compute the range-based F-score at k based on anomaly ranges.

range_pr_roc_auc_support(y_true, y_score[, ...])

Compute the range-based PR and ROC AUC.

range_roc_auc_score(y_true, y_score[, ...])

Compute the range-based area under the ROC curve.

range_pr_auc_score(y_true, y_score[, ...])

Compute the area under the range-based PR curve.

range_pr_vus_score(y_true, y_score[, ...])

Compute the range-based PR VUS score.

range_roc_vus_score(y_true, y_score[, ...])

Compute the range-based ROC VUS score.

AD Thresholding

percentile_threshold(y_score, percentile)

Calculate a threshold based on a percentile of the anomaly scores.

sigma_threshold(y_score[, factor])

Calculate a threshold based on the standard deviation of the anomaly scores.

top_k_points_threshold(y_true, y_score[, k])

Calculate a threshold such that at least k anomalous points are found.

top_k_ranges_threshold(y_true, y_score[, k])

Calculate a threshold such that at least k anomalies are found.