Skip to main content

Anomaly Detection in Streams with Extreme Value Theory

Code style: black GitHub Actions Test Coverage PyPI version Downloads

This repository wraps the original implementation of SPOT published in KDD'17 as an installable package. We refactor the original one, removing duplicated code. To verify the faithfulness, several test cases are introduced in tests/test_faithfulness.py.

Usage

Install this package via pip install ads-evt.

ads_evt has almost the same interface as the original implementation.

from typing import List
import matplotlib.pyplot as plt
import numpy as np

import ads_evt as spot


# physics.dat is a file in the original repository
with open("physics.dat", encoding="UTF-8") as obj:
    data = np.array(list(map(float, obj.read().split(","))))
init_data = 2000
proba = 1e-3
depth = 450

models: List[spot.SPOTBase] = [
    # spot.SPOT(q=proba),
    # spot.dSPOT(q=proba, depth=depth),
    # spot.biSPOT(q=proba),
    # The original implementation of bidSPOT uses n_points=8 for _grimshaw by default
    spot.bidSPOT(q=proba, depth=depth, n_points=8),
]
for alg in models:
    alg.fit(init_data=init_data, data=data)
    alg.initialize()
    results = alg.run()
    # Plot
    figs = alg.plot(results)
    plt.show()

For developers

Execute test cases with the following commands

# Install dependencies for development
git submodule update --init
python -m pip install -r requirements-dev.txt
# Execute test cases
coverage run
coverage report

Licences

GNU GPLv3

Metadata

Release files for ads-evt 0.0.4

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

Source distribution (sdist)

Source distribution for ads-evt 0.0.4
File Size Uploaded
ads-evt-0.0.4.tar.gz 8.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ads-evt 0.0.4
File Interpreter ABI Platform
ads_evt-0.0.4-py3-none-any.whl Python 3 none any Details

Total release size: 16.4 kB

Release files / ads-evt-0.0.4.tar.gz

Download URL ads-evt-0.0.4.tar.gz
Size 8.7 kB
Tags Source
SHA-256 checksum
How to use checksums
9528bcee794861c3a0ebedfeeb06a29cff85baa71b37d082c208c9d13a02cf2d
BLAKE2b-256 checksum
How to use checksums
40f4a8b083b79a36f54469e8c28527e3c09dca3884500256309a484afd09f154
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.13

Release files / ads_evt-0.0.4-py3-none-any.whl

Download URL ads_evt-0.0.4-py3-none-any.whl
Size 7.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
706094a3d60eaf933c4161dfe4e71f99ddc79818df439daa09a0b793cd9ec69f
BLAKE2b-256 checksum
How to use checksums
67fb0702555dfa0f9dde41a0ff2b8e669e8a5468c64c0c507837204a39672979
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.13

Release history Release notifications | RSS feed

This release

0.0.4 This release

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

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