mathurinm/celer

BUG more than one iteration done when fitting with alpha > alpha_max

mathurinm opened this issue · 0 comments

Probably not the most frequent case, and not very harmful, but writing it here for future reference:

import libsvmdata
from celer import Lasso
import numpy as np
from numpy.linalg import norm


X, y = libsvmdata.fetch_libsvm("rcv1.binary")
alpha_max = norm(X.T @ y, ord=np.inf) / len(y)

clf = Lasso(alpha_max * 2, verbose=1, fit_intercept=False)
clf.fit(X, y)
print(norm(clf.coef_))
assert clf.n_iter_ == 1