Skip to content

Commit

Permalink
Fix constraint upper bound and update to version 0.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
guillermo-navas-palencia committed Dec 11, 2022
1 parent 8a9dbdb commit 9e51169
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
24 changes: 12 additions & 12 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -214,17 +214,17 @@ The constraint has the general inequality form: ``lb <= A^Tx <= ub``.
>>> clf = LogisticRegression(solver="ecos", penalty="elasticnet", l1_ratio=0.5)
>>> clf.fit(X, y, bounds=bounds, constraints=constraints)
>>> clf.coef_
array([[-4.99999990e-01, 2.59127065e-09, 1.57855012e-09,
4.92952226e-10, -9.38544504e-07, -6.23158850e-01,
-9.99999485e-01, -4.41393438e-02, -1.50746141e-01,
-2.46375497e-07, -5.86201514e-07, -3.10883675e-09,
-7.35173366e-07, -4.48737109e-02, -1.71421755e-07,
-1.67941981e-07, -1.93139045e-07, -1.77770207e-07,
-1.83325585e-07, -1.63464915e-07, -1.76861958e-08,
-2.46764081e-01, -1.08368550e-01, 2.89353186e-10,
-6.39569062e-01, -9.99999975e-01, -9.99999982e-01,
-9.99999849e-01, -9.99999935e-01, -3.52251357e-06]])
array([[ 8.38950646e-10, 9.59874680e-10, 1.09096379e-09,
3.71912590e-10, -4.85762520e-07, -2.64846257e-01,
-8.30023820e-01, -2.06338097e-06, -3.66858725e-06,
-1.79685666e-07, -2.68157291e-07, -3.73083163e-09,
-3.11904337e-08, -5.04565568e-02, -1.39102635e-07,
-1.24094215e-07, -1.43485412e-07, -1.43613114e-07,
-1.46108738e-07, -1.31353775e-07, -6.01051773e-08,
-2.33773767e-01, -1.54775716e-01, -5.94112471e-11,
-3.88166017e-01, -9.99999970e-01, -9.99999980e-01,
-9.99999695e-01, -9.99999911e-01, -5.33323276e-07]])
>>> clf.intercept_
array([28.38190371])
array([25.95361153])
>>> clf.score(X, y)
0.9543057996485061
0.9507908611599297
2 changes: 1 addition & 1 deletion clogistic/_version.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
"""Version information."""

__version__ = "0.2.0"
__version__ = "0.3.0"
2 changes: 1 addition & 1 deletion clogistic/clogistic.py
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ def _fit_cvxpy(solver, penalty, tol, C, fit_intercept, max_iter, l1_ratio,
cons.append(lb[mask_lb] <= Abeta[mask_lb])

if np.any(mask_ub):
cons.append(Abeta[mask_ub] >= ub[mask_ub])
cons.append(Abeta[mask_ub] <= ub[mask_ub])

# Regularization
w = beta
Expand Down

0 comments on commit 9e51169

Please sign in to comment.