Skip to main content

Segmented regression models

Project description

segreg is a Python module for segmented regression.

Segmented regression models are defined as having breakpoints where the functional form changes. This project is currently limited in scope to the case of piecewise-linear and continuous univariate models with at most two breakpoints.

The segreg code fits segmented regression models to data using an exact algorithm due to Hudson. The primary implementation is based on cython. Alternative implementations are also provided in pure python, with or without numba.

Releases

This is a pre-release. Further small changes will be made before the code is considered available for general use.

https://zenodo.org/badge/DOI/10.5281/zenodo.5574166.svg

Installation

pip install segreg

We strongly recommended using a virtual environment (venv), or a conda environment, to avoid possible conflicts with other packages or other issues.

License

segreg is licensed under a BSD-3-Clause License. See LICENSE.

Documentation

For a technical overview of Segmented Regression and algorithms used in segreg, see segmented_regression.pdf.

Code documentation and a user guide shall be forthcoming.

Development Setup

To build core modules, run this:

python setup.py build_ext --inplace

This builds C code which has already been generated using cython. As such, there is no direct cython dependency.

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

segreg-0.0.3.tar.gz (457.0 kB view details)

Uploaded Source

File details

Details for the file segreg-0.0.3.tar.gz.

File metadata

  • Download URL: segreg-0.0.3.tar.gz
  • Upload date:
  • Size: 457.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.5

File hashes

Hashes for segreg-0.0.3.tar.gz
Algorithm Hash digest
SHA256 6565df481131b3716ae1392e1b388a0ea9033bedb1cfec8fb1eab82fca1ab967
MD5 344b6e294ff9804c5fc19b523138a5f6
BLAKE2b-256 3aa8012923dd209b5b6275bb9068d2e9333bd68412ae979c986ebf5bc59adb69

See more details on using hashes here.

Supported by

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