Banpei
Anomaly detection library based on singular spectrum transformation(sst)
Install / Use
/learn @tsurubee/BanpeiREADME
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
$ 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.
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.

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.
Related Skills
claude-opus-4-5-migration
84.6kMigrate prompts and code from Claude Sonnet 4.0, Sonnet 4.5, or Opus 4.1 to Opus 4.5
model-usage
341.6kUse CodexBar CLI local cost usage to summarize per-model usage for Codex or Claude, including the current (most recent) model or a full model breakdown. Trigger when asked for model-level usage/cost data from codexbar, or when you need a scriptable per-model summary from codexbar cost JSON.
TrendRadar
50.1k⭐AI-driven public opinion & trend monitor with multi-platform aggregation, RSS, and smart alerts.🎯 告别信息过载,你的 AI 舆情监控助手与热点筛选工具!聚合多平台热点 + RSS 订阅,支持关键词精准筛选。AI 智能筛选新闻 + AI 翻译 + AI 分析简报直推手机,也支持接入 MCP 架构,赋能 AI 自然语言对话分析、情感洞察与趋势预测等。支持 Docker ,数据本地/云端自持。集成微信/飞书/钉钉/Telegram/邮件/ntfy/bark/slack 等渠道智能推送。
mcp-for-beginners
15.7kThis open-source curriculum introduces the fundamentals of Model Context Protocol (MCP) through real-world, cross-language examples in .NET, Java, TypeScript, JavaScript, Rust and Python. Designed for developers, it focuses on practical techniques for building modular, scalable, and secure AI workflows from session setup to service orchestration.
