{"about":{"site":"https://codewithpapers.app","non_affiliation":"Code with Papers and Syntology are not affiliated with, endorsed by, or sponsored by Papers with Code, Meta, or the pwc-archive mirror.","licence":"CC BY-SA 4.0","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","attribution":"https://codewithpapers.app/attribution","modified":"archive material modified by Syntology; see the attribution page"},"url":"/paper/local-evaluation-of-time-series-anomaly","title":"Local Evaluation of Time Series Anomaly Detection Algorithms","arxiv_id":"2206.13167","date":"2022-06-27","proceeding":null,"authors":["Alexis Huet","Jose Manuel Navarro","Dario Rossi"],"abstract":"In recent years, specific evaluation metrics for time series anomaly detection algorithms have been developed to handle the limitations of the classical precision and recall. However, such metrics are heuristically built as an aggregate of multiple desirable aspects, introduce parameters and wipe out the interpretability of the output. In this article, we first highlight the limitations of the classical precision/recall, as well as the main issues of the recent event-based metrics -- for instance, we show that an adversary algorithm can reach high precision and recall on almost any dataset under weak assumption. To cope with the above problems, we propose a theoretically grounded, robust, parameter-free and interpretable extension to precision/recall metrics, based on the concept of ``affiliation'' between the ground truth and the prediction sets. Our metrics leverage measures of duration between ground truth and predictions, and have thus an intuitive interpretation. By further comparison against random sampling, we obtain a normalized precision/recall, quantifying how much a given set of results is better than a random baseline prediction. By construction, our approach keeps the evaluation local regarding ground truth events, enabling fine-grained visualization and interpretation of algorithmic results. We compare our proposal against various public time series anomaly detection datasets, algorithms and metrics. We further derive theoretical properties of the affiliation metrics that give explicit expectations about their behavior and ensure robustness against adversary strategies.","url_abs":"https://arxiv.org/abs/2206.13167v1","url_pdf":"https://arxiv.org/pdf/2206.13167v1.pdf","source":{"archive":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","row_kind":"abstracts"},"code_links":[{"paper_slug":"local-evaluation-of-time-series-anomaly","repo_url":"https://github.com/ahstat/affiliation-metrics-py","is_official":1,"mentioned_in_paper":0,"mentioned_in_github":0,"framework":"none","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"anomaly-detection","task_name":"Anomaly Detection"},{"task_slug":"time-series-1","task_name":"Time Series"},{"task_slug":"time-series","task_name":"Time Series Analysis"},{"task_slug":"time-series-anomaly-detection","task_name":"Time Series Anomaly Detection"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":"https://syntology.ai/paper/2206.13167","atlas_url":"https://app.syntology.ai/?focus=2206.13167","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2206.13167"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-25T09:33:49+00:00","read_at_is":"when the build read Syntology's graph, not when any sample ran","claim":"Per-sample execution status on synthesized fixtures; not a correctness claim about the paper. Samples come from repositories linked to the paper, official or community; repo_kind says which.","repos":[{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/ahstat/affiliation-metrics-py","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran":9},"by_repo_kind":{"official":{"samples":9,"ran":9,"repositories":1}},"repo_kind_vocabulary":{"official":"The archive marks this repository official for the paper","named_in_paper":"The archive records that the paper mentions this repository; it is not marked official","listed":"In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper","found_in_text":"Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted","community":"Not in the archive's code links for this paper; a community repository Syntology harvested"},"n_pointer_only_for_licence":0,"samples":[{"code_sha256_prefix":"d404bee58fedcd26","entry":"E_gt_func","repo":"ahstat/affiliation-metrics-py","repo_kind":"official","path":"affiliation/_affiliation_zone.py","file_url":"https://github.com/ahstat/affiliation-metrics-py/blob/HEAD/affiliation/_affiliation_zone.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"d404bee58fedcd26"}},{"code_sha256_prefix":"8f8697a132293736","entry":"convert_vector_to_events","repo":"ahstat/affiliation-metrics-py","repo_kind":"official","path":"affiliation/generics.py","file_url":"https://github.com/ahstat/affiliation-metrics-py/blob/HEAD/affiliation/generics.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"8f8697a132293736"}},{"code_sha256_prefix":"356c56fa1f7667a1","entry":"has_point_anomalies","repo":"ahstat/affiliation-metrics-py","repo_kind":"official","path":"affiliation/generics.py","file_url":"https://github.com/ahstat/affiliation-metrics-py/blob/HEAD/affiliation/generics.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"356c56fa1f7667a1"}},{"code_sha256_prefix":"d2e653db871e18d5","entry":"infer_Trange","repo":"ahstat/affiliation-metrics-py","repo_kind":"official","path":"affiliation/generics.py","file_url":"https://github.com/ahstat/affiliation-metrics-py/blob/HEAD/affiliation/generics.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"d2e653db871e18d5"}},{"code_sha256_prefix":"19f48f4d2af20ece","entry":"interval_intersection","repo":"ahstat/affiliation-metrics-py","repo_kind":"official","path":"affiliation/_integral_interval.py","file_url":"https://github.com/ahstat/affiliation-metrics-py/blob/HEAD/affiliation/_integral_interval.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"19f48f4d2af20ece"}},{"code_sha256_prefix":"224f0e59f24ef978","entry":"interval_length","repo":"ahstat/affiliation-metrics-py","repo_kind":"official","path":"affiliation/_integral_interval.py","file_url":"https://github.com/ahstat/affiliation-metrics-py/blob/HEAD/affiliation/_integral_interval.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"224f0e59f24ef978"}},{"code_sha256_prefix":"64b9b03651a884fd","entry":"sum_interval_lengths","repo":"ahstat/affiliation-metrics-py","repo_kind":"official","path":"affiliation/_integral_interval.py","file_url":"https://github.com/ahstat/affiliation-metrics-py/blob/HEAD/affiliation/_integral_interval.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"64b9b03651a884fd"}},{"code_sha256_prefix":"69f0580795e596bb","entry":"t_start","repo":"ahstat/affiliation-metrics-py","repo_kind":"official","path":"affiliation/_affiliation_zone.py","file_url":"https://github.com/ahstat/affiliation-metrics-py/blob/HEAD/affiliation/_affiliation_zone.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"69f0580795e596bb"}},{"code_sha256_prefix":"d67287c6f0371922","entry":"t_stop","repo":"ahstat/affiliation-metrics-py","repo_kind":"official","path":"affiliation/_affiliation_zone.py","file_url":"https://github.com/ahstat/affiliation-metrics-py/blob/HEAD/affiliation/_affiliation_zone.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"d67287c6f0371922"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}