Skip to content

Piecewise Linear Fit with automated selection of line segments

License

Notifications You must be signed in to change notification settings

nweerasuriya/auto_pwlf

Repository files navigation

Auto PWLF

Piecewise Linear Fit with ability to automatically find the optimal number of line segments. In addition outliers can be detected and avoided during the fitting process.

Full Documentation can be found here: Documentation

Installation available through pip: https://pypi.org/project/autopwlf/

pip install autopwlf

image

The piecewise fitting uses the pwlf module with full credit to all contributors to this package.

How it works

The currently available Piecewise Linear Fit models in Python do not have a method to determine the optimal number of break points to use. To do so this package performs the following steps:

  1. Smooth the data using a rolling median function
  2. Fit a linear interpolation function on the smoothened data
  3. Use scipy find_peaks function to find the number of extrema points
  4. Filter by primenence to return an estimate on the number of break points

About

Piecewise Linear Fit with automated selection of line segments

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages