Skip to main content

No project description provided

Project description

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)

Documentation & Links

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pybocd-1.1.0.tar.gz (185.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pybocd-1.1.0-py3-none-any.whl (22.2 kB view details)

Uploaded Python 3

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

Hashes for pybocd-1.1.0.tar.gz
Algorithm Hash digest
SHA256 d2ee86dfc7b8bbf47f51cdfc99146ea4c0bb060f085a04420ae273adaae8d8a3
MD5 1dc34cf652dc0d4bc0059c3ff5d0dac7
BLAKE2b-256 6b9b92219b584a45e665873c61a95b368d4a2a5272daae4bec84c39bf70accab

See more details on using hashes here.

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

Hashes for pybocd-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 608264517c14c262e1645e007ffd8b59de48223d4a7338b422333399cb0e395f
MD5 c65be23bf2d9aee2b048a18ede3330cd
BLAKE2b-256 3fa4332c05ea4f3accd9b4362a7e7e3050b77fbbe287fd8e41e2057005cbda43

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page