{"id":8605,"library":"ropwr","title":"RoPWR: Robust Piecewise Regression","description":"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.","status":"active","version":"1.2.0","language":"python","source_language":"en","source_url":"https://github.com/guillermo-navas-palencia/ropwr","tags":["regression","piecewise","robust","optimization","convex-optimization","cvxpy","machine-learning","statistics"],"install":[{"cmd":"pip install ropwr","lang":"bash","label":"Install base package"},{"cmd":"pip install 'ropwr[all]' # Installs common CVXPY solvers like Clarabel, SCS, OSQP, ECOS","lang":"bash","label":"Install with all optional solvers"}],"dependencies":[{"reason":"Core numerical operations and array handling.","package":"numpy","optional":false},{"reason":"Data manipulation, often used for input data.","package":"pandas","optional":false},{"reason":"Machine learning utilities, estimators, and data preprocessing.","package":"scikit-learn","optional":false},{"reason":"Convex optimization problem formulation and solving; core engine for RoPWR.","package":"cvxpy","optional":false},{"reason":"Default SOCP solver for CVXPY, recommended for performance.","package":"clarabel","optional":true},{"reason":"A conic-problem solver for CVXPY.","package":"scs","optional":true},{"reason":"An operator splitting solver for quadratic programs.","package":"osqp","optional":true}],"imports":[{"wrong":"from ropwr import RoPWR","symbol":"RobustPWRegression","correct":"from ropwr import RobustPWRegression"}],"quickstart":{"code":"import numpy as np\nfrom ropwr import RoPWR\n\n# Generate some synthetic data\nnp.random.seed(0)\nX = np.linspace(0, 10, 100).reshape(-1, 1)\ny = np.where(X < 5, 2 * X, -X + 15).flatten() + np.random.normal(0, 1, 100)\n\n# Initialize and fit the RoPWR model with 2 segments\nmodel = RoPWR(n_segments=2, solver='Clarabel', random_state=42)\nmodel.fit(X, y)\n\n# Make predictions\ny_pred = model.predict(X)\n\nprint(f\"Predicted y for X[0]: {y_pred[0]:.2f}\")\nprint(f\"R^2 score: {model.score(X, y):.2f}\")","lang":"python","description":"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."},"warnings":[{"fix":"Upgrade ropwr to version 1.2.0 or higher. If unable to upgrade ropwr, downgrade scikit-learn to <1.6.","message":"Incompatibility with scikit-learn 1.6+ due to `force_all_finite` deprecation.","severity":"gotcha","affected_versions":"<1.2.0"},{"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'`.","message":"Older versions of RoPWR might experience OSQP solver convergence issues, especially with complex problems.","severity":"gotcha","affected_versions":"<0.4.0"},{"fix":"Upgrade ropwr to version 1.0.0 or higher to utilize the `max_iter` parameter.","message":"The `max_iter` parameter for controlling solver iterations was introduced in v1.0.0. Attempting to use it with older versions will raise an AttributeError.","severity":"gotcha","affected_versions":"<1.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.","message":"Key features like enforcing continuous derivatives at split points and extrapolation methods were added in v1.0.0.","severity":"gotcha","affected_versions":"<1.0.0"}],"env_vars":null,"search_vec":"'1.2.0':44 'addit':55 'convex':19,65 'convex-optim':64 'current':41 'cvxpi':39,67 'depend':58 'driven':52 'everi':48 'featur':54 'flexibl':25 'framework':26 'implement':14 'improv':56 'learn':70 'librari':12 'linear':31 'machin':69 'machine-learn':68 'model':28 'month':50 'non':30 'non-linear':29 'occur':47 'optim':20,63,66 'piecewis':3,7,16,61 'primarili':51 'provid':23 'python':11 'regress':4,8,17,60 'relationship':32 'releas':46 'robust':2,6,15,62 'ropwr':1,5 'segment':34 'solver':37 'statist':71 'support':35 'techniqu':21 'updat':59 'use':18 'various':36 'version':42 'via':38","created_at":"2026-04-16T17:03:03.489297+00:00","updated_at":"2026-04-16T17:03:03.489297+00:00","problems":null,"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"1.2.0","cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/guillermo-navas-palencia/ropwr","docs":null,"changelog":null,"pypi":"https://pypi.org/project/ropwr/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["data","ai-ml"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-06-30","last_verified":"2026-06-30","next_check":"2026-07-30","install_tag":null}}