No project description provided
Project description
pybocd
pybocd implements Bayesian Online Changepoint Detection (BOCD) with two built-in observation models:
- BOCD-NIG: conjugate Normal–Inverse–Gamma model for unknown mean and variance.
- BOCD-GMM: particle-based Gaussian mixture model for multimodal data and outliers.
Installation
pip install pybocd
If you install from source for development, ensure numpy, scipy, and pandas are available.
Quickstart — BOCD-NIG
from pybocd import BOCDNIG
# prior: m0, kappa0, alpha0, beta0; l: expected run length; threshold: pruning
model = BOCDNIG(m_0=0.0, kappa_0=1.0, alpha_0=1.0, beta_0=1.0, l=200.0, threshold=1e-4)
for x in stream_of_floats:
model.add_data(x)
# model.run_length_dist and model.run_length show current posterior
Quickstart — BOCD-GMM
from pybocd import BOCDGMM
# The GMM-based BOCD requires several hyperparameters — see source for details.
model = BOCDGMM(alpha_0=2.0, beta_0=2.0, m_0=0.0, kappa_0=1.0,
alpha_p_0=2.0, beta_p_0=2.0, mu_p_0=0.0, sigma_p_sq_0=1.0,
jitter_mu=0.01, jitter_sigma_sq=0.01, jitter_tau_sq=0.01, jitter_pi=0.01,
l=200.0, m=20, n=200, init_particle_n=50)
for x in stream_of_floats:
model.add_data(x)
Documentation & Links
- Documentation: https://zeyu-xie.github.io/pybocd/
- PyPI: https://pypi.org/project/pybocd/
- Examples repository: https://github.com/Zeyu-Xie/pybocd-Examples
Data Attributes
During development, data sourced from Westermo is used, which is licensed under the Creative Commons Attribution 4.0 International (CC BY 4.0) License. We gratefully acknowledge Westermo for making this real-world telemetry data available for research and development purposes.
License
pybocd is distributed under the terms of the GPL-3.0-or-later license.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pybocd-1.1.0.tar.gz.
File metadata
- Download URL: pybocd-1.1.0.tar.gz
- Upload date:
- Size: 185.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d2ee86dfc7b8bbf47f51cdfc99146ea4c0bb060f085a04420ae273adaae8d8a3
|
|
| MD5 |
1dc34cf652dc0d4bc0059c3ff5d0dac7
|
|
| BLAKE2b-256 |
6b9b92219b584a45e665873c61a95b368d4a2a5272daae4bec84c39bf70accab
|
File details
Details for the file pybocd-1.1.0-py3-none-any.whl.
File metadata
- Download URL: pybocd-1.1.0-py3-none-any.whl
- Upload date:
- Size: 22.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
608264517c14c262e1645e007ffd8b59de48223d4a7338b422333399cb0e395f
|
|
| MD5 |
c65be23bf2d9aee2b048a18ede3330cd
|
|
| BLAKE2b-256 |
3fa4332c05ea4f3accd9b4362a7e7e3050b77fbbe287fd8e41e2057005cbda43
|