Skip to main content

A simple-to-use Python package for time series anomaly detection!

Project description

dtaianomaly

Time series anomaly detection

Unit tests Doctest docs-stable docs-latest PyPi Version Downloads PyPI pyversions PyPI license Code style: black InTimeAD UI

A simple-to-use Python package for the development and analysis of time series anomaly detection techniques. Here we describe the main usage of dtaianomaly, but be sure to check out the documentation for more information.

Installation

The preferred way to install dtaianomaly is via PyPi. See the documentation for more options.

pip install dtaianomaly

Features

The three key features of dtaianomaly are as follows:

  1. State-of-the-art time series anomaly detection via a simple API. Learn more!
  2. Develop custom models for anomaly detection. Learn more!
  3. Quantitative evaluation of time series anomaly detection. Learn more!

Example

Below code shows a simple example of dtaianomaly, which is part of the anomaly detection notebook. More examples are provided in the other notebooks and in the documentation.

from dtaianomaly.data import demonstration_time_series
from dtaianomaly.preprocessing import MovingAverage
from dtaianomaly.anomaly_detection import MatrixProfileDetector

# Load the data
X, y = demonstration_time_series()

# Preprocess the data using a moving average
preprocessor = MovingAverage(window_size=10)
X_, _ = preprocessor.fit_transform(X)

# Fit the matrix profile detector on the processed data
detector = MatrixProfileDetector(window_size=100)
detector.fit(X_)

# Compute either the decision scores, specific to the detector, or the anomaly probabilities
decision_scores = detector.decision_function(X_)
anomaly_probabilities = detector.predict_proba(X_)

Demonstration-time-series-detected-anomalies.svg

Acknowledgments

If you find dtaianomaly useful for your work, we would appreciate the following citation:

@article{carpentier2025dtaianomaly,
      title={{dtaianomaly: A Python library for time series anomaly detection}}, 
      author={Louis Carpentier and Nick Seeuws and Wannes Meert and Mathias Verbeke},
      year={2025},
      eprint={2502.14381},
      archivePrefix={arXiv},
      primaryClass={cs.LG},
      url={https://arxiv.org/abs/2502.14381}, 
}

Carpentier, L., Seeuws, N., Meert, W., Verbeke, M.: dtaianomaly: A Python library for time series anomaly detection (2025), https://arxiv.org/abs/2502.14381

Contribute

The goal of dtaianomaly is to be community-driven. All types of contributions are welcome. This includes code, but also bug reports, improvements to the documentation, additional tests and more. Check out the documentation to find more information about how you can contribute!

License

Copyright (c) 2023-2025 KU Leuven, DTAI Research Group

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dtaianomaly-0.5.1.tar.gz (136.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dtaianomaly-0.5.1-py3-none-any.whl (208.3 kB view details)

Uploaded Python 3

File details

Details for the file dtaianomaly-0.5.1.tar.gz.

File metadata

  • Download URL: dtaianomaly-0.5.1.tar.gz
  • Upload date:
  • Size: 136.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for dtaianomaly-0.5.1.tar.gz
Algorithm Hash digest
SHA256 0fc381d62ca4e5f5f9bd3452cffc6f28b3ad0e42e3933f011946535375e66a90
MD5 0e34ed7e9e4aa6bf5f3316dd0b416427
BLAKE2b-256 41d65542e50674835e45228005534f772aee495e447061f7f60d4f663e7551d3

See more details on using hashes here.

Provenance

The following attestation bundles were made for dtaianomaly-0.5.1.tar.gz:

Publisher: release-execute.yml on ML-KULeuven/dtaianomaly

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file dtaianomaly-0.5.1-py3-none-any.whl.

File metadata

  • Download URL: dtaianomaly-0.5.1-py3-none-any.whl
  • Upload date:
  • Size: 208.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for dtaianomaly-0.5.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b54d2b544bb3f8da18b9a41e04ffa03e94354f3cabb3f43d9cc70339d9a8392f
MD5 aac0b06d221e89fdb8090c47a35cae70
BLAKE2b-256 cd66b2adeca502ce37ada75f2c8c337aed50ac3abfe906fd311ced7c0de84015

See more details on using hashes here.

Provenance

The following attestation bundles were made for dtaianomaly-0.5.1-py3-none-any.whl:

Publisher: release-execute.yml on ML-KULeuven/dtaianomaly

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page