Git Product home page Git Product logo

banpei's Introduction

Banpei

Build Status

Banpei is a Python package of the anomaly detection.
Anomaly detection is a technique used to identify unusual patterns that do not conform to expected behavior.

System

Python ^3.6 (2.x is not supported)

Installation

$ pip install banpei

After installation, you can import banpei in Python.

$ python
>>> import banpei

Usage

Example

Singular spectrum transformation(sst)

import banpei 
model   = banpei.SST(w=50)
results = model.detect(data)

The input 'data' must be one-dimensional array-like object containing a sequence of values.
The output 'results' is Numpy array with the same size as input data.
The graph below shows the change-point scoring calculated by sst for the periodic data.

sst_example

The data used is placed as '/tests/test_data/periodic_wave.csv'. You can read a CSV file using the following code.

import pandas as pd
raw_data = pd.read_csv('./tests/test_data/periodic_wave.csv')
data = raw_data['y']

SST processing can be accelerated using the Lanczos method which is one of Krylov subspace methods by specifying True for the is_lanczos argument like below.

results = model.detect(data, is_lanczos=True)

Real-time monitoring with Bokeh

Banpei is developed with the goal of constructing the environment of real-time abnormality monitoring. In order to achieve the goal, Banpei has the function corresponded to the streaming data. With the help of Bokeh, which is great visualization library, we can construct the simple monitoring tool.
Here's a simple demonstration movie of change-point detection of the data trends.

sst detection
https://youtu.be/7_woubLAhXk
The sample code how to construct real-time monitoring environment is placed in '/demo' folder.

The implemented algorithm

Outlier detection

  • Hotelling's theory

Change point detection

  • Singular spectrum transformation(sst)

License

This project is licensed under the terms of the MIT license, see LICENSE.

banpei's People

Contributors

gabrielvon avatar tsurubee 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  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

banpei's Issues

ERROR: No matching distribution found for banpei

pip install banpei is throwing error:

ERROR: Could not find a version that satisfies the requirement banpei (from versions: none)
ERROR: No matching distribution found for banpei

I have been using Python 3.7.4
2020-07-16

test_sst.py

Hello,

I have tried to run the tests/test_sst.py.
I got following output:

``test_sst.py -v
test_detect_by_lanczos (main.TestSST) ... ok
test_detect_by_svd (main.TestSST) ... ok
test_stream_detect (main.TestSST) ... ok


Ran 3 tests in 0.019s

OK
``
How do I get the change point score as an output?

Thanks

module 'banpei' has no attribute 'SST'

Following the Usage tutorial got the following error:

AttributeError                            Traceback (most recent call last)
<ipython-input-6-99f3ee034564> in <module>
----> 1 model   = banpei.SST(w=20)
      2 results = model.detect(data)

AttributeError: module 'banpei' has no attribute 'SST'

Citation for banpei

Hello,
I am using banpei for change point detection in my thesis. I would like to cite this work but could not find any citations. It would be great to have Bibtex entry for citation.
Thank You

ERROR: Could not find a version that satisfies the requirement banpei

I am trying to do pipenv install banpei in my virtual env, it is throwing the following error:

Installing banpei…
Error:  An error occurred while installing banpei!
Error text: 
ERROR: Could not find a version that satisfies the requirement banpei (from -r /tmp/pipenv-00uw2ca1-requirements/pipenv-x3l4m4in-requirement.txt (line 1)) (from versions: none)
ERROR: No matching distribution found for banpei (from -r /tmp/pipenv-00uw2ca1-requirements/pipenv-x3l4m4in-requirement.txt (line 1))

banpei

detect anomalies on sequential data

Hi
i'm working on anomaly detection on energy consumption so i have a semi-sequential data. i tested the sst method and i don't think it works form me because it just detect a changing point, i tried to test the Hotelling method but i didn't understand how it works, can someone help me please.

demo code not working

Hello
Nothing happens when I run the "sst_detect.py" code under the "demo" folder.
I am using python 3.7 on Windows 10.

regards,

Get the number positivity

I have a rule that throws numbers between -50 and 50 randomly, is there any way to predict the sign (positive or negative) of the next release with at least 90% accuracy based on a historical record?

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.