FIX missing fabs in w_max cf.
@@ -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
