# Linear Segmentation
[![Build Status](https://travis-ci.org/kylessmith/bcpseg.svg?branch=master)](https://travis-ci.org/kylessmith/linear_segmentation) [![PyPI version](https://badge.fury.io/py/bcpseg.svg)](https://badge.fury.io/py/linear_segmentation)
[![Coffee](https://img.shields.io/badge/-buy_me_a%C2%A0coffee-gray?logo=buy-me-a-coffee&color=ff69b4)](https://www.buymeacoffee.com/kylessmith)
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
```python
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
```
Raw data
{
"_id": null,
"home_page": "https://github.com/kylessmith/linear_segment",
"name": "linear_segment",
"maintainer": "Kyle S. Smith",
"docs_url": null,
"requires_python": "<4.0,>=3.10",
"maintainer_email": "kyle.smith@stjude.org",
"keywords": "cython, bayesian, changepoint, circular, segment, c",
"author": "Kyle S. Smith",
"author_email": "kyle.smith@stjude.org",
"download_url": "https://files.pythonhosted.org/packages/0b/97/a2660efb01d2f453fe2e36331807b868699b5b0bf49990c9a206474df79e/linear_segment-1.1.2.tar.gz",
"platform": null,
"description": "# Linear Segmentation\n\n[![Build Status](https://travis-ci.org/kylessmith/bcpseg.svg?branch=master)](https://travis-ci.org/kylessmith/linear_segmentation) [![PyPI version](https://badge.fury.io/py/bcpseg.svg)](https://badge.fury.io/py/linear_segmentation)\n[![Coffee](https://img.shields.io/badge/-buy_me_a%C2%A0coffee-gray?logo=buy-me-a-coffee&color=ff69b4)](https://www.buymeacoffee.com/kylessmith)\n\nlinear_segmentation using Bayesian Change Point Segmentation or Circular Binary segmentation.\n\n\n## Install\n\nIf you dont already have numpy and scipy installed, it is best to download\n`Anaconda`, a python distribution that has them included. \n```\n https://continuum.io/downloads\n```\n\nDependencies can be installed by:\n\n```\n pip install -r requirements.txt\n```\n\nPyPI install, presuming you have all its requirements installed:\n```\n\tpip install linear_segment\n```\n\n## Usage\n\n```python\nfrom linear_segment import segment\nimport numpy as np\n\n# Create data\nnp.random.seed(10)\nx = np.random.random(300000)\nx[10000:20000] = x[10000:20000] + 0.1\nx[25000:27000] = x[25000:27000] - 1\nlabels = np.repeat('a', len(x))\n\n# Calculate segments\nsegments = segment(x, labels, method=\"online_both\")\nsegments\nsegments = segment(x, labels, method=\"cbs\")\nsegments\n\n```\n\n",
"bugtrack_url": null,
"license": "GPL-2.0-or-later",
"summary": "Python package for Bayesian Change Point and Circular Binary Segmentation",
"version": "1.1.2",
"project_urls": {
"Documentation": "https://www.biosciencestack.com/static/linear_segment/docs/index.html",
"Homepage": "https://github.com/kylessmith/linear_segment",
"Repository": "https://github.com/kylessmith/linear_segment"
},
"split_keywords": [
"cython",
" bayesian",
" changepoint",
" circular",
" segment",
" c"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "83eabbf8a6f09f0dccfc22d9b46f4def8bdc0fb7263c57e9538410f0350ead6c",
"md5": "711a0efdc8e88254b72a07115421da25",
"sha256": "e42cb64ce502e7173cc4afedbc066bebbc0855f00530d38db1af08f20c9535b6"
},
"downloads": -1,
"filename": "linear_segment-1.1.2-cp311-cp311-macosx_14_0_x86_64.whl",
"has_sig": false,
"md5_digest": "711a0efdc8e88254b72a07115421da25",
"packagetype": "bdist_wheel",
"python_version": "cp311",
"requires_python": "<4.0,>=3.10",
"size": 528275,
"upload_time": "2024-04-16T15:23:14",
"upload_time_iso_8601": "2024-04-16T15:23:14.664934Z",
"url": "https://files.pythonhosted.org/packages/83/ea/bbf8a6f09f0dccfc22d9b46f4def8bdc0fb7263c57e9538410f0350ead6c/linear_segment-1.1.2-cp311-cp311-macosx_14_0_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "0b97a2660efb01d2f453fe2e36331807b868699b5b0bf49990c9a206474df79e",
"md5": "eecfaf2ea30fb5dbe190e9748dc5b2f1",
"sha256": "f47116696c942fbfce6961bc86a6bffc71e053f0f4e5ad9e8db46a0e836a78cc"
},
"downloads": -1,
"filename": "linear_segment-1.1.2.tar.gz",
"has_sig": false,
"md5_digest": "eecfaf2ea30fb5dbe190e9748dc5b2f1",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.10",
"size": 502252,
"upload_time": "2024-04-16T15:23:16",
"upload_time_iso_8601": "2024-04-16T15:23:16.614393Z",
"url": "https://files.pythonhosted.org/packages/0b/97/a2660efb01d2f453fe2e36331807b868699b5b0bf49990c9a206474df79e/linear_segment-1.1.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-04-16 15:23:16",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "kylessmith",
"github_project": "linear_segment",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"requirements": [],
"lcname": "linear_segment"
}