Python package for Bayesian Change Point and Circular Binary Segmentation
Project description
Linear Segmentation
linear_segmentation using Bayesian Change Point Segmentation or Circular Binary segmentation.
Install
If you dont already have numpy and scipy installed, it is best to download
Anaconda
, a python distribution that has them included.
https://continuum.io/downloads
Dependencies can be installed by:
pip install -r requirements.txt
PyPI install, presuming you have all its requirements installed:
pip install linear_segment
Usage
from linear_segment import segment
import numpy as np
# Create data
np.random.seed(10)
x = np.random.random(300000)
x[10000:20000] = x[10000:20000] + 0.1
x[25000:27000] = x[25000:27000] - 1
labels = np.repeat('a', len(x))
# Calculate segments
segments = segment(x, labels, method="online_both")
segments
segments = segment(x, labels, method="cbs")
segments
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
linear_segment-1.1.0.tar.gz
(262.3 kB
view hashes)
Built Distribution
Close
Hashes for linear_segment-1.1.0-cp310-cp310-macosx_13_0_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d2504e496453493b9523d5aefb300eb9263bb5445e8c65e86fb84bb5ee7d8ea6 |
|
MD5 | 25065b7f06086db62c6194c398364755 |
|
BLAKE2b-256 | 21ecd02585ae042781a53d3ef43f270b44197aff4148f2208a1a77e6b2243ca2 |