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,
            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

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.6.tar.gz (11.8 kB view details)

Uploaded Source

Built Distribution

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

anomalywatchdog-0.0.6-py3-none-any.whl (19.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: anomalywatchdog-0.0.6.tar.gz
  • Upload date:
  • Size: 11.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.5 CPython/3.8.18 Linux/6.8.0-1017-azure

File hashes

Hashes for anomalywatchdog-0.0.6.tar.gz
Algorithm Hash digest
SHA256 eeb93689e37728f1a79ec80ffa6f25b76164f3ea90627ebd3a6f7e3e2739d2a6
MD5 d5c331ae8702d157672abc900fd1a041
BLAKE2b-256 2a0c64bea8651e618e061fa029295675e8458b024e8708b74b2f7f32f8e57b7a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: anomalywatchdog-0.0.6-py3-none-any.whl
  • Upload date:
  • Size: 19.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.5 CPython/3.8.18 Linux/6.8.0-1017-azure

File hashes

Hashes for anomalywatchdog-0.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 c4b4da562b540a51b609191a8dcd8f2720da3a1720471cdffc48be1275096764
MD5 e987a82a22f8d518a784024ac8c7a816
BLAKE2b-256 e8f9693c82b76943301ae9189bb58341e114355d8b4e9de71937bbadf2f35dc1

See more details on using hashes here.

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