Metadata-Version: 2.1
Name: tsadmetrics
Version: 1.0.7
Summary: Librería para evaluación de detección de anomalías en series temporales
Author-email: Pedro Rafael Velasco Priego <i12veprp@uco.es>
Requires-Python: >=3.8
Description-Content-Type: text/markdown
Requires-Dist: numpy==1.24.4
Requires-Dist: pandas==2.0.3
Requires-Dist: PATE==0.1.1
Requires-Dist: PyYAML==6.0.2
Provides-Extra: dev
Requires-Dist: pytest==8.3.5; extra == "dev"
Requires-Dist: iniconfig==2.1.0; extra == "dev"
Requires-Dist: pluggy==1.5.0; extra == "dev"
Requires-Dist: tomli==2.2.1; extra == "dev"
Requires-Dist: exceptiongroup==1.3.0; extra == "dev"
Requires-Dist: ipython>=7.0; extra == "dev"
Requires-Dist: sphinx; extra == "dev"
Requires-Dist: sphinx-rtd-theme; extra == "dev"
Requires-Dist: numpydoc; extra == "dev"
Requires-Dist: myst-parser; extra == "dev"

# TSADmetrics - Time Series Anomaly Detection Metrics

**TSADmetrics** is a Python library for evaluating anomaly detection algorithms in time series data.  
It provides a comprehensive set of metrics specifically designed to handle the temporal nature of anomalies.

---

## Features

- **Metric Taxonomy**: Metrics are categorized into types based on how they handle temporal context:

  - **MPI Metrics**: Evaluate predictions at each point independently, ignoring temporal continuity.
  - **MET Metrics**: Consider temporal context, analyzing when and how anomalies occur.
    - **MDPT**: Partial detection within a real anomaly event counts as correct.
    - **MDTP**: Requires detection to cover a significant fraction of the real anomaly.
    - **MECT**: Measures alignment of real vs predicted anomaly events.
    - **MPR**: Penalizes late detections.
    - **MTDT**: Allows temporal tolerance for early or late detections.

- **Direct Metric Usage**: Instantiate any metric class and call `compute()` for individual evaluation.

- **Batch Evaluation**: Use `Runner` to evaluate multiple datasets and metrics at once, with support for both direct data and CSV/JSON input.

- **Flexible Configuration**: Load metrics from YAML configuration files or global evaluation config files.

- **CLI Tool**: Compute metrics directly from files without writing Python code.

---

## Installation

Install TSADmetrics via pip:

```bash
pip install tsadmetrics
```

## Documentation

The complete documentation for TSADmetrics is available at:  
📚 [https://tsadmetrics.readthedocs.io/](https://tsadmetrics.readthedocs.io/)

## Acknowledgements

This library is based on the concepts and implementations from:  
Sørbø, S., & Ruocco, M. (2023). *Navigating the metric maze: a taxonomy of evaluation metrics for anomaly detection in time series*. https://doi.org/10.1007/s10618-023-00988-8
