timeSeriesAnomalyMetrics
Compute specialized evaluation metrics for time series anomaly detection
Since R2026a
Syntax
Description
Add-On Required: This feature requires the Time Series Anomaly Detection for MATLAB add-on.
Time-series anomaly detection metrics evaluate subsequence anomalies, where the anomalous behavior occurs over a series of consecutive points, rather than at a single point. These evaluation metrics provide additional granularity and insight into the performance of a detector.
The function handles both supervised and unsupervised evaluation.
Unsupervised means that the time series data is not labeled to reflect ground truth.
Supervised means that the time series data does contain labels that provide ground truth.
computes unsupervised evaluation metrics without incorporating knowledge of ground
truth.evalmetrics = timeSeriesAnomalyMetrics(Predictions,[],Scores)
Use this syntax when you have no labeled data ground truth data. The
[] element in the syntax indicates that there are no values in
Labels.
uses supervised evaluation metrics for detection results that incorporate the ground truth
that evalmetrics = timeSeriesAnomalyMetrics(Predictions,Labels)Labels contains.
specifies additional options using name-value arguments. You can specify these options with
any of the previous input-argument combinations.evalmetrics = timeSeriesAnomalyMetrics(___,Name=Value)
Input Arguments
Name-Value Arguments
Output Arguments
References
[1] Kim, Siwon, Kukjin Choi, Hyun-Soo Choi, Byunghan Lee, and Sungroh Yoon. “Towards a Rigorous Evaluation of Time-Series Anomaly Detection.” Proceedings of the AAAI Conference on Artificial Intelligence 36, no. 7 (2022): 7194–201. https://doi.org/10.1609/aaai.v36i7.20680.
Version History
Introduced in R2026a