Lasso on sklearn does not converge

When I run something like

import numpy
from sklearn import linear_model
A= #something
b= #something
clf=linear_model.Lasso(alpha=0.015, fit_intercept=False, tol=0.00000000000001,
          max_iter=10000000000000, positive=True),b)

I get the error:

sklearn/linear_model/ UserWarning: Objective did not
converge. You might want to increase the number of iterations
' to increase the number of iterations')

The interesting thing is that A is never rank defficient. (I think)


Try increasing tol.

From the documentation:

tol : float, optional

The tolerance for the optimization: if the updates are smaller than tol, the optimization code checks the dual gap for optimality and continues until it is smaller than tol.

The default for tol is 0.0001 on my version of scikit-learn. I assume that your tolerance is so small that the optimization never reaches a lower value.

Leave a Reply

Your email address will not be published. Required fields are marked *