Skip to main content

No project description provided

Project description

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,
            models_to_use: List[str] = ['auto_arima', 'Prophet'],
            check_history: bool = False
        )

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.
  • 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".
  • check_history: Boolean that checks outliers in the complete history of the time series if True, and only in the last day if false (default).

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

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

anomalywatchdog-0.0.2.tar.gz (11.4 kB view details)

Uploaded Source

Built Distribution

anomalywatchdog-0.0.2-py3-none-any.whl (18.9 kB view details)

Uploaded Python 3

File details

Details for the file anomalywatchdog-0.0.2.tar.gz.

File metadata

  • Download URL: anomalywatchdog-0.0.2.tar.gz
  • Upload date:
  • Size: 11.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.8.18 Linux/6.5.0-1022-azure

File hashes

Hashes for anomalywatchdog-0.0.2.tar.gz
Algorithm Hash digest
SHA256 4b8fc3f9bf80c70c21a05c9acf7e59cc7ec2543d12f5af79ff3a870aed68e007
MD5 8dcaa07df469d5808109fdb5c8475e65
BLAKE2b-256 9915e89f00802cc0d20f60832d78a71bdabb8cc701cec36a1b1e601c7bb995d2

See more details on using hashes here.

File details

Details for the file anomalywatchdog-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: anomalywatchdog-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 18.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.8.18 Linux/6.5.0-1022-azure

File hashes

Hashes for anomalywatchdog-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 dbe0820bd095927aff79ad3ef24abc348ad986ac0ed87ca1a2d3528ed7341433
MD5 46a85360bf043b292c8b35fd4c57d214
BLAKE2b-256 87b705660427391f3847565d5559581bc49483c6b83efe9723a5245e7b7b8834

See more details on using hashes here.

Supported by

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