Skip to main content

Detect outliers of sequence in stream.

Project description

StreamOutlierDetector

Detect outliers of sequence in stream.
In this project we have some assumption:

  • This project works online that means has no idea about the future data
  • This project forget older data (more than size of sample array)
  • If more than half of sample array be in outlier then this project assume the majority is not outlier and calculate outlier detection for the sample again

Usage

install

pip install pyood
pip install --upgrade pyood # if you want update package

How use it

from pyood import OutlierDetector

outlier_detector = OutlierDetector(bound_factor_standard_deviation=3, window_size=20, size_initial_ignore=10)

is_outlier = outlier_detector.push(your_value)

if you want, you can use it with callback function

from pyood import OutlierDetector

def result(is_outlier):
    print(is_outlier)

outlier_detector = OutlierDetector(bound_factor_standard_deviation=3, window_size=20, size_initial_ignore=10)

is_outlier = outlier_detector.push(value=your_value, callback=result)

Help

bound_factor_standard_deviation is the factor that multiple with standard deviation. |value - mean| > bound_factor_standard_deviation * satandard deviation is the outlier.
window_size is the size of array is effective for finding outlier.
first_learning_number is the number of first value we ignore and learn from them.

Warning ⚠
if the outlier be in the first first_learning_number we return it is not outlier and more dangerous we learn it and ruined the mean and variance for a while

Result

I test this class and show the functionality of it on a chart.
❌ are the outliers we detect.
🔵 are the normal values.
- are the bound of outlier detection.

Without bound With bounds

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

pyood-0.2.1-py3-none-any.whl (16.8 kB view details)

Uploaded Python 3

File details

Details for the file pyood-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: pyood-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 16.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.0

File hashes

Hashes for pyood-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 72dba145b56334fc537c60f179fafd564c486defefc7c58b43cbbd3861c72c70
MD5 30595a10c9d0a9640237c37b480a84f3
BLAKE2b-256 249edc506151aa52c7787032b1566fe7a28758fbd03278ce0b88aa36c4395a52

See more details on using hashes here.

Provenance

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