Skip to main content

pybocd

PyPI - Version PyPI - Python Version


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)

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.

Metadata

Release files for pybocd 1.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pybocd 1.1.0
File Size Uploaded Provenance Actions
pybocd-1.1.0.tar.gz 185.7 kB Without provenance Details for pybocd-1.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pybocd 1.1.0
File Interpreter ABI Platform Actions
pybocd-1.1.0-py3-none-any.whl Python 3 none any Details for pybocd-1.1.0-py3-none-any.whl

Total release size: 207.9 kB

Release files / pybocd-1.1.0.tar.gz

Download URL pybocd-1.1.0.tar.gz
Size 185.7 kB
Tags Source
SHA-256 checksum
How to use checksums
d2ee86dfc7b8bbf47f51cdfc99146ea4c0bb060f085a04420ae273adaae8d8a3
BLAKE2b-256 checksum
How to use checksums
6b9b92219b584a45e665873c61a95b368d4a2a5272daae4bec84c39bf70accab
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.8

Release files / pybocd-1.1.0-py3-none-any.whl

Download URL pybocd-1.1.0-py3-none-any.whl
Size 22.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
608264517c14c262e1645e007ffd8b59de48223d4a7338b422333399cb0e395f
BLAKE2b-256 checksum
How to use checksums
3fa4332c05ea4f3accd9b4362a7e7e3050b77fbbe287fd8e41e2057005cbda43
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.8

Security for pybocd 1.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page