Registry / data / ropwr
library1.2.0pypypi✓ verified 85d ago

RoPWR (Robust Piecewise Regression) is a Python library that implements robust piecewise regression using convex optimization techniques. It provides a flexible framework to model non-linear relationships with segments, supporting various solvers via CVXPY. The current version is 1.2.0, with releases occurring every few months, primarily driven by feature additions, improvements, and dependency updates.

pip install ropwr
INSTALL
IMPORT
SIG · ROPWR
R
ropwr
datapythonv1.2.0
Install
12.2s avg
Import
Disk
378MB
Pass rate
5/ 10
Env Coverage5 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.2.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.940 runs
build_error
glibc
py 3.103.940 runs
installs and imports cleanly · install 12.2s · import 0.000s · 324MB
378MB installed
● package 378MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

RobustPWRegression
from ropwr import RobustPWRegression
from ropwr import RoPWR

This quickstart demonstrates how to instantiate, fit, and predict with the `RoPWR` model. It creates a simple dataset with two linear segments and fits a `RoPWR` model with two segments. The 'Clarabel' solver is specified, which is efficient for SOCP problems.

import numpy as np from ropwr import RoPWR # Generate some synthetic data np.random.seed(0) X = np.linspace(0, 10, 100).reshape(-1, 1) y = np.where(X < 5, 2 * X, -X + 15).flatten() + np.random.normal(0, 1, 100) # Initialize and fit the RoPWR model with 2 segments model = RoPWR(n_segments=2, solver='Clarabel', random_state=42) model.fit(X, y) # Make predictions y_pred = model.predict(X) print(f"Predicted y for X[0]: {y_pred[0]:.2f}") print(f"R^2 score: {model.score(X, y):.2f}")
Debug
Known issues
gotchaIncompatibility with scikit-learn 1.6+ due to `force_all_finite` deprecation.
fix
Upgrade ropwr to version 1.2.0 or higher. If unable to upgrade ropwr, downgrade scikit-learn to <1.6.
affects: <1.2.0
gotchaOlder versions of RoPWR might experience OSQP solver convergence issues, especially with complex problems.
fix
Upgrade ropwr to version 0.4.0 or higher. If using an older version, try specifying a different solver (e.g., `solver='Clarabel'` or `solver='SCS'`) or use `solver='auto'`.
affects: <0.4.0
gotchaThe `max_iter` parameter for controlling solver iterations was introduced in v1.0.0. Attempting to use it with older versions will raise an AttributeError.
fix
Upgrade ropwr to version 1.0.0 or higher to utilize the `max_iter` parameter.
affects: <1.0.0
gotchaKey features like enforcing continuous derivatives at split points and extrapolation methods were added in v1.0.0.
fix
Ensure ropwr is version 1.0.0 or higher if your application requires these features. Refer to the documentation for how to enable continuous derivatives or specific extrapolation methods.
affects: <1.0.0
Upgrade
Version history
1.2.0latest on PyPI · released Jan 23, 2026
Audit
Dependencies
numpyrequiredCore numerical operations and array handling.
pandasrequiredData manipulation, often used for input data.
scikit-learnrequiredMachine learning utilities, estimators, and data preprocessing.
cvxpyrequiredConvex optimization problem formulation and solving; core engine for RoPWR.
clarabeloptionalDefault SOCP solver for CVXPY, recommended for performance.
scsoptionalA conic-problem solver for CVXPY.
osqpoptionalAn operator splitting solver for quadratic programs.
Agent activity
15 hits · last 30 days
node
12
OpenAI (training)
1
Resources
ropwr — pip install ropwr · libregistry