skillfed

aplr

Automatic Piecewise Linear Regression

aplr v10.24.1 334.3K downloads/30d#7,493 on PyPI25
Permissive license MIT Active released

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 aplr

uv

uv add aplr

poetry

poetry add aplr

Installing 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

License :: OSI Approved :: MIT License

Tags

piecewise linear regressioninterpretable machine learning modelsregression classification pythonautomatic model fittingsmooth predictive modelslinear regression alternativeexplainable ml
interpretable-mlregression-classificationpiecewise-linear

More Artificial Intelligence packages