aplr
Automatic Piecewise Linear Regression
What it is and what it does
APLR is a machine learning library that implements automatic piecewise linear regression, a methodology for building predictive models that split the input space into regions and fit linear models within each. It targets both regression and classification tasks, working with numpy arrays and pandas DataFrames. The core appeal is interpretability: piecewise linear models are easier to understand and explain than black-box methods like neural networks or complex tree ensembles, while the library claims to match or exceed their predictive accuracy in many cases.
The package provides a scikit-learn-like API with fit and predict methods, plus a tuning utility for hyperparameter optimization. It requires numpy and pandas as runtime dependencies and supports Python 3.8 and later across Windows, macOS, and Linux. The library is actively maintained, with recent releases and responsive development.
Use it for:
- Building regression models where interpretability is as important as accuracy, such as in finance or healthcare.
- Classification tasks where you need to explain decision boundaries to stakeholders or regulators.
- Benchmarking against tree-based methods when you want smoother, more continuous predictions.
- Tuning hyperparameters systematically using the provided APLR tuner utility.
- Exploratory data analysis where piecewise linear fits reveal structure in relationships between variables.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
APLR builds interpretable regression and classification models using automatic piecewise linear regression, offering smoother predictions than tree-based methods while maintaining competitive accuracy.
Yes, if you need interpretable regression or classification models and want an alternative to tree-based or black-box methods. The active maintenance, permissive MIT license, and lack of known vulnerabilities make it a low-risk choice. Medium install friction is typical for compiled packages and should not be a barrier. Start with the published article and examples to assess whether the methodology fits your problem.
Install
aplr on PyPI
pip
pip install aplruv
uv add aplrpoetry
poetry add aplrInstalling aplr
Before you install
Medium install friction due to compiled wheels across multiple platforms (Windows, macOS, Linux). Active maintenance with a release 1 day old and last commit on 2026-08-13 suggests responsive development. Depends on numpy and pandas, both widely available.
License in practice
MIT license is permissive; you can use, modify, and distribute APLR with minimal restrictions, provided you include the license notice.
Quickstart
pip install aplr
import pandas as pd
from aplr import APLR
model = APLR()
model.fit(X_train, y_train)
predictions = model.predict(X_test)
Requires Python 3.8 or later; numpy and pandas must be installed as runtime dependencies.
Verify before relying
- Whether APLR's accuracy claims against tree-based methods hold across diverse datasets and problem types.
- Performance characteristics and scalability limits for large datasets.
- Whether the optional plotting dependencies (aplr[plots]) are necessary for typical workflows.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.8) |
| Install friction | medium — platform-specific wheel |
| Runtime dependencies | 2 — numpy, pandas |
| Maintenance | actively maintained — 1 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 334,301/month — #7,493 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: aplr-10.24.1-cp310-cp310-macosx_11_0_arm64.whl; aplr-10.24.1-cp310-cp310-macosx_11_0_x86_64.whl; aplr-10.24.1-cp310-cp310-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl; aplr-10.24.1-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl; aplr-10.24.1-cp310-cp310-win32.whl; aplr-10.24.1-cp310-cp310-win_amd64.whl; aplr-10.24.1-cp310-cp310-win_arm64.whl; aplr-10.24.1-cp311-cp311-macosx_11_0_arm64.whl; aplr-10.24.1-cp311-cp311-macosx_11_0_x86_64.whl; aplr-10.24.1-cp311-cp311-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl; aplr-10.24.1-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl; aplr-10.24.1-cp311-cp311-win32.whl; aplr-10.24.1-cp311-cp311-win_amd64.whl; aplr-10.24.1-cp311-cp311-win_arm64.whl; aplr-10.24.1-cp312-cp312-macosx_11_0_arm64.whl; aplr-10.24.1-cp312-cp312-macosx_11_0_x86_64.whl; aplr-10.24.1-cp312-cp312-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl; aplr-10.24.1-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl; aplr-10.24.1-cp312-cp312-win32.whl; aplr-10.24.1-cp312-cp312-win_amd64.whl
Tags
More Artificial Intelligence packages
LiteLLM provides a unified Python interface to…
permissive · top 100 on PyPI
huggingface-hubClient library and CLI tool for downloading,…
permissive · top 100 on PyPI
langchainLangChain provides a framework for building…
permissive · top 1,000 on PyPI
hf-xethf-xet provides chunk-based deduplication and…
permissive · top 1,000 on PyPI
tokenizersTokenizers converts raw text into token…
permissive · top 1,000 on PyPI
transformersTransformers provides a unified framework for…
permissive · top 1,000 on PyPI
piecewise-regressionFits piecewise linear regression models to data…
permissive · top 15,000 on PyPI
pwlfFits continuous piecewise linear functions to…
permissive · top 15,000 on PyPI
ropwrRoPWR computes optimal piecewise polynomial…
permissive · top 15,000 on PyPI
limeLime explains individual predictions from any…
permissive · top 15,000 on PyPI
interpret-coreTrains interpretable machine learning models…
unclear · top 5,000 on PyPI
interpretInterpretML provides interpretable machine…
unclear · top 15,000 on PyPI
pyjptpyjpt learns and reasons about joint…
unclear · top 15,000 on PyPI
skope-rulesSkope-rules learns interpretable logical rules…
permissive · top 15,000 on PyPI
linearmodelsProvides panel regression, instrumental…
unclear · top 15,000 on PyPI
glumglum is a high-performance Python library for…
permissive · top 15,000 on PyPI