piecewise-regression
Advanced tools
+5
-2
@@ -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 @@ |
+1
-1
| 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 |
+1
-1
@@ -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 " |
+19
-0
@@ -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() | ||
Alert delta unavailable
Currently unable to show alert delta for PyPI packages.
109041
0.67%2062
0.54%