Anomaly Detection in Streams with Extreme Value Theory
Project description
Anomaly Detection in Streams with Extreme Value Theory
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
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
ads-evt-0.0.4.tar.gz
(8.7 kB
view details)
Built Distribution
File details
Details for the file ads-evt-0.0.4.tar.gz
.
File metadata
- Download URL: ads-evt-0.0.4.tar.gz
- Upload date:
- Size: 8.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9528bcee794861c3a0ebedfeeb06a29cff85baa71b37d082c208c9d13a02cf2d |
|
MD5 | 626f69cd1bc4e29fda1c9b7b1a0f902c |
|
BLAKE2b-256 | 40f4a8b083b79a36f54469e8c28527e3c09dca3884500256309a484afd09f154 |
File details
Details for the file ads_evt-0.0.4-py3-none-any.whl
.
File metadata
- Download URL: ads_evt-0.0.4-py3-none-any.whl
- Upload date:
- Size: 7.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 706094a3d60eaf933c4161dfe4e71f99ddc79818df439daa09a0b793cd9ec69f |
|
MD5 | a5d55c1fa2525f6b4579122971e9b895 |
|
BLAKE2b-256 | 67fb0702555dfa0f9dde41a0ff2b8e669e8a5468c64c0c507837204a39672979 |