Skip to content

Commit

Permalink
missing fabs in w_max cf. scikit-learn#10992
Browse files Browse the repository at this point in the history
  • Loading branch information
agramfort committed Apr 18, 2018
1 parent 0c424ce commit 17a4310
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions sklearn/linear_model/cd_fast.pyx
Expand Up @@ -480,8 +480,9 @@ def sparse_enet_coordinate_descent(floating [:] w,
if d_w_ii > d_w_max:
d_w_max = d_w_ii

if w[ii] > w_max:
w_max = w[ii]
if fabs(w[ii]) > w_max:
w_max = fabs(w[ii])

if w_max == 0.0 or d_w_max / w_max < d_w_tol or n_iter == max_iter - 1:
# the biggest coordinate update of this iteration was smaller than
# the tolerance: check the duality gap as ultimate stopping
Expand Down

0 comments on commit 17a4310

Please sign in to comment.