You're Invited:Meet the Socket Team at RSAC and BSidesSF 2026, March 23–26.RSVP
Socket
Book a DemoSign in
Socket

piecewise-regression

Package Overview
Dependencies
Maintainers
1
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

piecewise-regression - pypi Package Compare versions

Comparing version
1.2.0
to
1.2.1
+5
-2
docs/README.rst

@@ -6,5 +6,6 @@ ==========================================================

:Author: Charlie Pilgrim
:Version: 1.2.0
:Version: 1.2.1
:Github: https://github.com/chasmani/piecewise-regression
:Documentation: https://piecewise-regression.readthedocs.io/en/master/index.html
:Paper: https://joss.theoj.org/papers/10.21105/joss.03859

@@ -32,4 +33,6 @@ .. image:: https://github.com/chasmani/piecewise-regression/actions/workflows/python-package.yml/badge.svg

Easy-to-use piecewise regression (aka segmented regression) in Python. For fitting straight lines to data where there are one or more changes in gradient (known as breakpoints). Based on Muggeo's paper "Estimating regression models with unknown break-points" (2003).
Easy-to-use piecewise regression (aka segmented regression) in Python. For fitting straight lines to data where there are one or more changes in gradient (known as breakpoints). Based on Muggeo's paper "Estimating regression models with unknown break-points" (2003).
When using the package, please cite the `accompanying paper <https://joss.theoj.org/papers/10.21105/joss.03859>`_.
Example:

@@ -36,0 +39,0 @@

Metadata-Version: 2.1
Name: piecewise-regression
Version: 1.2.0
Version: 1.2.1
Summary: piecewise (segmented) regression in python

@@ -5,0 +5,0 @@ Home-page: https://github.com/chasmani/piecewise-regression

@@ -63,3 +63,3 @@

self.yy = yy
self.current_breakpoints = current_breakpoints
self.current_breakpoints = sorted(current_breakpoints)
self.n_breakpoints = len(current_breakpoints)

@@ -591,3 +591,3 @@

print("Generating some random breakpoints: ", start_values)
return start_values
return sorted(start_values)

@@ -594,0 +594,0 @@

Metadata-Version: 2.1
Name: piecewise-regression
Version: 1.2.0
Version: 1.2.1
Summary: piecewise (segmented) regression in python

@@ -5,0 +5,0 @@ Home-page: https://github.com/chasmani/piecewise-regression

@@ -6,3 +6,3 @@ import setuptools

name="piecewise-regression",
version="1.2.0",
version="1.2.1",
description="piecewise (segmented) regression in python",

@@ -9,0 +9,0 @@ long_description= "piecewise-regression provides tools for fitting "

@@ -501,3 +501,22 @@ from piecewise_regression.main import Fit, Muggeo

def test_issue_with_breakpoint_ordering(self):
np.random.seed(4)
x = list(range(20))
y = list(range(0, 5, 1)) + list(range(5, 0, -1)) + list(range(0, 10, 2)) + list(range(10 , 0, -2))
pw_fit = Fit(x, y, n_breakpoints=3)
pw_results = pw_fit.get_results()
pw_estimates = pw_results["estimates"]
self.assertAlmostEqual(
pw_estimates["alpha1"]["estimate"], 1, places=0)
self.assertAlmostEqual(
pw_estimates["alpha2"]["estimate"], -1, places=0)
if __name__ == '__main__':
unittest.main()