Skip to main content

AnomalyWatchdog

AnomalyWatchdog detects outliers for time series using both statistical and machine learning approaches and showcase them. It works for both daily, weekly and monthly data.

If a time series split in different dimensions is provided, AnomalyWatchdog first groups the data by the id provided and analyzes outliers at its highest level. If an outlier is detected, it will analyze outliers at the different dimensions to detect the origin of the anomaly.

Installation

pip install AnomalyWatchdog

Quickstart

To detect anomalies in your data, you need to insert the following parameters in the AnomalyWatchdog class as you can see below.

from anomalywatchdog import AnomalyWatchdog

anomaly_watchdog = AnomalyWatchdog(
            df: Union[pd.DataFrame, DataFrame],
            column_date: str,
            column_target: str,
            granularity: str,
            columns_dimension: list[str] = None,
            start_date: Union[str, None] = None,
            end_date: Union[str, None] = None,
            models_to_use: List[str] = ['auto_arima', 'Prophet'],
        )

Inputs

AnomalyWatchdog has the following inputs:

  • df: pandas DataFrame or spark DataFrame that contains the required column_id, column_date, column_target and columns_dimension.
  • column_date: String containing the column name of the time series dates. Values should be str in format YYYY-MM-DD (i.e. 2020-01-30).
  • column_target: String containing the column name of the time series values. Values should be float or int.
  • granularity: String containing the granularity of the time series data. Values available are "D" for daily, "M" for monthly and "W" for weekly data.
  • columns_dimension: List of strings containing the column dimension names representing the disaggregation of the data if any.
  • start_date: String containing the start date to return anomalies. Values should be str in format YYYY-MM-DD (i.e. 2020-01-30). If None, it returns all the history.
  • end_date: String containing the end date to return anomalies. Values should be str in format YYYY-MM-DD (i.e. 2020-01-30). If None, it returns all the history.
  • models_to_use: List of strings containing the models available. Models available are "autoencoder_basic", "autoencoder_lstm", "prophet" and "auto_arima". If non value is provided, AnomalyWatchdog performs with only "prophet" and "auto_arima".

Outputs

AnomalyWatchdog has two outputs, one of which is only delivered if columns_dimension parameter is specified.

# -- AnomalyWatchdog output for main time series
anomaly_watchdog.df_anomaly
# -- AnomalyWatchdog output for each of the dimensions (only if columns_dimension is specified)
anomaly_watchdog.df_anomaly_dimension

Metadata

Release files for anomalywatchdog 0.0.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for anomalywatchdog 0.0.7
File Size Uploaded Provenance Actions
anomalywatchdog-0.0.7.tar.gz 11.3 kB Without provenance Details for anomalywatchdog-0.0.7.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for anomalywatchdog 0.0.7
File Interpreter ABI Platform Actions
anomalywatchdog-0.0.7-py3-none-any.whl Python 3 none any Details for anomalywatchdog-0.0.7-py3-none-any.whl

Total release size: 30.7 kB

Release files / anomalywatchdog-0.0.7.tar.gz

Download URL anomalywatchdog-0.0.7.tar.gz
Size 11.3 kB
Tags Source
SHA-256 checksum
How to use checksums
f39ecbad611fbe30c94c4a34fd5acda2f65cdebc88d3a62b218b4c836ff0f636
BLAKE2b-256 checksum
How to use checksums
27c48f5b037077cf71f83945b6880150400da302269a047adc50278c2497fbc5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.0.1 CPython/3.9.21 Linux/6.8.0-1017-azure

Release files / anomalywatchdog-0.0.7-py3-none-any.whl

Download URL anomalywatchdog-0.0.7-py3-none-any.whl
Size 19.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ae56a4a58dae8bf46ac37108248a748106f1df95bbdab2578c62f5acc5bb5bd2
BLAKE2b-256 checksum
How to use checksums
54041cdc76bc4cd8c2be2844117e7bcad6a798a8144c6c23eebd6dee6caebf28
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.0.1 CPython/3.9.21 Linux/6.8.0-1017-azure

Security for anomalywatchdog 0.0.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page