Convergencewarning in the Lasso CV method - What can I do to solve the problem?

Asked

Viewed 155 times

1

Could someone help me with this mistake?

Convergencewarning: Objective Did not converge. You Might want to Increase the number of iterations. Duality gap: 3.5998713265016704, tolerance: 2.032346947042441 Tol, Rng, Random, Positive)

Lasso = LassoCV(normalize=True, cv=cv1, max_iter=60000000)

I’ve already increased the value of max_iter of the method as you can see, but these warnings continue to happen and I believe that this may interfere in my results.

Does anyone know any solution to this ?

1 answer

0


The Warning happens by the nonconvergence of the technique. This can happen depending on the data. Apply a standard scaling instead of normalization.

from sklearn.preprocessing import StandardScaler
scaler = StandardScaler().fit(X)
X_scaled = scaler.transform(X)

And then use X_scaled in your experiments (but remember to change the Lasso normalization to normalize=False.

  • Could you give me a hint, how to use?

  • I changed the answer. Managed to solve?

Browser other questions tagged

You are not signed in. Login or sign up in order to post.