Code Monkey home page Code Monkey logo

anomaly-detection's Introduction

AnomalyDetection and BreakoutDetection in python

This is a python implementation of Twitter's AnomalyDetection and BreakoutDetection.

Install

The dependencies contain C++ and Fortran code, so that you need gcc installed. Checkout the code, enter the folder and run:

pip install -r requirements.txt

When use this as a library, please include the line for "pyloess" from "requirements.txt" in your "requirements.txt".

Usage

The parameters are the same as the AnomalyDetectionVec in Twitter's AnomalyDetection (except the plot related ones). You need to put your time series data into a list of float numbers:

from anoms import detect_anoms
from breakout import detect_breakout

x = list()

\# put the data into x

res = detect_anoms(x, max_anoms=0.02, alpha=0.01, direction='both')

res will be a list of int numbers, consists the index of detected anomalies in x. If e_value=True is set, res will be a tuple, whose first value is the list of index of detected anomalies and the second value is the list of expected values.

res = detect_breakout(x, min_size=24, method='multi', beta=0.001, degree=1)

res will be a list of int numbers, consists the index of detected breakout in x.

anomaly-detection's People

Contributors

alexmkt avatar liujingchen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

anomaly-detection's Issues

Import detect_anom issue : pyloess/_loess.so: undefined symbol: drot_

Hello,
I'm facing an import issue
I was able to successfully install the anomaly-detection module on my machine.


geo@geo-VM ~/git_forks/anomaly-detection $ pip install -r requirements.txt
Obtaining file:///home/geo/git_forks/anomaly-detection (from -r requirements.txt (line 2))
Obtaining pyloess from git+git://github.com/andreas-h/pyloess.git@7415090e00c3987eecc44be2efcfbdaf038656e0#egg=pyloess (from -r requirements.txt (line 1))
  Skipping because already up-to-date.
Requirement already satisfied: pandas>=0.12.0 in /home/geo/anaconda2/lib/python2.7/site-packages (from anomaly-detection==0.0.1->-r requirements.txt (line 2))
Requirement already satisfied: scipy>=0.15.1 in /home/geo/anaconda2/lib/python2.7/site-packages (from anomaly-detection==0.0.1->-r requirements.txt (line 2))
Requirement already satisfied: numpy>=1.9.2 in /home/geo/anaconda2/lib/python2.7/site-packages (from anomaly-detection==0.0.1->-r requirements.txt (line 2))
Requirement already satisfied: python-dateutil in /home/geo/anaconda2/lib/python2.7/site-packages (from pandas>=0.12.0->anomaly-detection==0.0.1->-r requirements.txt (line 2))
Requirement already satisfied: pytz>=2011k in /home/geo/anaconda2/lib/python2.7/site-packages (from pandas>=0.12.0->anomaly-detection==0.0.1->-r requirements.txt (line 2))
Requirement already satisfied: six>=1.5 in /home/geo/anaconda2/lib/python2.7/site-packages (from python-dateutil->pandas>=0.12.0->anomaly-detection==0.0.1->-r requirements.txt (line 2))
Installing collected packages: pyloess, anomaly-detection
  Found existing installation: pyloess 0.0.0
    Uninstalling pyloess-0.0.0:
      Successfully uninstalled pyloess-0.0.0
  Running setup.py develop for pyloess
  Found existing installation: anomaly-detection 0.0.1
    Uninstalling anomaly-detection-0.0.1:
      Successfully uninstalled anomaly-detection-0.0.1                                                                                                                                                                                                                             
  Running setup.py develop for anomaly-detection                                                                                                                                                                                                                                   
Successfully installed anomaly-detection pyloess

The breakout module is imported successfully ,
However I can't import the detect_anoms module :

from anoms import detect_anoms
Traceback (most recent call last):

  File "<ipython-input-3-64a1d18eec73>", line 1, in <module>
    from anoms import detect_anoms

  File "/home/geo/git_forks/anomaly-detection/anoms.py", line 2, in <module>
    from pyloess import stl

  File "/home/geo/git_forks/anomaly-detection/src/pyloess/pyloess.py", line 41, in <module>
    import _lowess, _stl, _loess

ImportError: /home/geo/git_forks/anomaly-detection/src/pyloess/_loess.so: undefined symbol: drot_

Could you please help me in finding the root cause of this import ?
It looks related to the pyloess library but I'm not sure if it's the library itself or if something went wrong in the installation process.
Thanks a lot !

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.