Skip to content

Commit

Permalink
Merge branch 'develop' into updating-residuals
Browse files Browse the repository at this point in the history
  • Loading branch information
lennybronner committed Sep 24, 2024
2 parents 64debde + e551069 commit 585ae38
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# Changelog
### 2.1.1 - 2024-09-12
- chore: Updated all required packages to their latest versions. Switched `QuantileRegressionSolver`'s solver from `ECOS` to `Clarabel` [#22](https://github.com/washingtonpost/elex-solver/pull/22)

### 2.1.0 - 2024-03-29
- feat: Transition matrix solver. [#17](https://github.com/washingtonpost/elex-solver/pull/17)

Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

from setuptools import find_packages, setup

INSTALL_REQUIRES = ["cvxpy~=1.4", "numpy~=1.26", "scipy~=1.12"]
INSTALL_REQUIRES = ["cvxpy~=1.5", "numpy~=2.1", "scipy~=1.14"]

THIS_FILE_DIR = os.path.dirname(__file__)

Expand All @@ -13,7 +13,7 @@
LONG_DESCRIPTION = f.read()

# The full version, including alpha/beta/rc tags
RELEASE = "2.1.0"
RELEASE = "2.1.1"
# The short X.Y version
VERSION = ".".join(RELEASE.split(".")[:2])

Expand Down
4 changes: 2 additions & 2 deletions src/elexsolver/QuantileRegressionSolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,15 @@ def _fit_with_regularization(
Fits quantile regression with regularization
TODO: convert this problem to use the dual like in the non regularization case
"""
arguments = {"ECOS": {"max_iters": 10000}}
arguments = {cp.CLARABEL: {"max_iter": 10000}}
coefficients = cp.Variable((x.shape[1],))
y_hat = x @ coefficients
residual = y - y_hat
loss_function = cp.sum(cp.multiply(weights, 0.5 * cp.abs(residual) + (tau - 0.5) * residual))
loss_function += lambda_ * self._get_regularizer(coefficients, regularize_intercept, n_feat_ignore_reg)
objective = cp.Minimize(loss_function)
problem = cp.Problem(objective)
problem.solve(solver="ECOS", **arguments.get("ECOS", {}))
problem.solve(solver=cp.CLARABEL, **arguments.get(cp.CLARABEL, {}))
return coefficients.value

def fit(
Expand Down

0 comments on commit 585ae38

Please sign in to comment.