Skip to main content

Linear Segmentation

Build Status PyPI version Coffee

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

Metadata

Release files for linear-segment 1.1.1

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

Source distribution (sdist)

Source distribution for linear-segment 1.1.1
File Size Uploaded
linear_segment-1.1.1.tar.gz 262.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for linear-segment 1.1.1
File Interpreter ABI Platform
linear_segment-1.1.1-cp311-cp311-macosx_14_0_x86_64.whl CPython 3.11 CPython 3.11 macOS 14.0+ x86-64 Details

Total release size: 768.2 kB

Release files / linear_segment-1.1.1.tar.gz

Download URL linear_segment-1.1.1.tar.gz
Size 262.3 kB
Tags Source
SHA-256 checksum
How to use checksums
7d993a17b66f045601dac9cdc68f8d67f462ea048b3bf36d465c59123d45eeee
BLAKE2b-256 checksum
How to use checksums
34ce5cdd292d4706ce6b77f5fd0947e9677b3ff1cc5086f2a51d0af6f930c7a7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.7.1 CPython/3.11.3 Darwin/23.1.0

Release files / linear_segment-1.1.1-cp311-cp311-macosx_14_0_x86_64.whl

Download URL linear_segment-1.1.1-cp311-cp311-macosx_14_0_x86_64.whl
Size 506.0 kB
Tags CPython 3.11 macOS 14.0+ x86-64
SHA-256 checksum
How to use checksums
bfb75c0c41cdb04b48946c97dbf8dd75955f025d8022cbd9791335742b6327f9
BLAKE2b-256 checksum
How to use checksums
8886230b1837a2e7c23f8fcfab6381ed2ac8ac96ad15dfbe729e9bbe0a3576f1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.7.1 CPython/3.11.3 Darwin/23.1.0

Release history Release notifications | RSS feed

1.2.3

2 release files

1.2.2

2 release files

1.2.1

2 release files

1.2.0

2 release files

1.1.2

2 release files

This release

1.1.1 This release

2 release files

1.1.0

2 release files

1.0.0

2 release files

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