https://github.com/tsurubee/banpei
Anomaly detection library based on singular spectrum transformation(sst)
https://github.com/tsurubee/banpei
anomaly-detection python time-series-analysis
Last synced: about 2 months ago
JSON representation
Anomaly detection library based on singular spectrum transformation(sst)
- Host: GitHub
- URL: https://github.com/tsurubee/banpei
- Owner: tsurubee
- License: mit
- Created: 2017-09-23T13:27:30.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2020-09-21T14:00:06.000Z (over 4 years ago)
- Last Synced: 2024-07-31T21:53:38.461Z (9 months ago)
- Topics: anomaly-detection, python, time-series-analysis
- Language: Python
- Homepage:
- Size: 792 KB
- Stars: 301
- Watchers: 11
- Forks: 47
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-TS-anomaly-detection - banpei - series. | MIT | ❌ (Anomaly Detection Software)
README
## Banpei
[](https://travis-ci.org/tsurubee/banpei)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
```bash
$ pip install banpei
```
After installation, you can import banpei in Python.
```
$ python
>>> import banpei
```## Usage
#### Example
*Singular spectrum transformation(sst)*
```python
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.
The data used is placed as '/tests/test_data/periodic_wave.csv'. You can read a CSV file using the following code.
```python
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.
```python
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.[](https://www.youtube.com/watch?v=7_woubLAhXk)
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.