Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

`SparseCoder` doesn't expose `max_iter` for `Lasso` #12650

Closed
adrinjalali opened this issue Nov 22, 2018 · 3 comments · Fixed by #12682
Closed

`SparseCoder` doesn't expose `max_iter` for `Lasso` #12650

adrinjalali opened this issue Nov 22, 2018 · 3 comments · Fixed by #12682
Labels

Comments

@adrinjalali
Copy link
Member

@adrinjalali adrinjalali commented Nov 22, 2018

SparseCoder uses Lasso if the algorithm is set to lasso_cd. It sets some of the Lasso's parameters, but not max_iter, and that by default is 1000. This results in a warning in examples/decomposition/plot_sparse_coding.py complaining that the estimator has not converged.

I guess there should be a way for the user to specify other parameters of the estimator used in SparseCoder other than the ones provided in the SparseCoder.__init__ right now.

@jnothman

This comment has been minimized.

Copy link
Member

@jnothman jnothman commented Nov 25, 2018

Are you thinking a lasso_kwargs parameter?

@adrinjalali

This comment has been minimized.

Copy link
Member Author

@adrinjalali adrinjalali commented Nov 25, 2018

yeah, more like algorithm_kwargs I suppose, to cover Lasso, LassoLars, and Lars

But I was looking at the code to figure how many parameters are not covered by what's already given to SparseCoder, and there's not many. In fact, max_iter is a parameter to SparseCoder, not passed to LassoLars (hence the warning I saw in the example), and yet used when Lasso is used.

Looks like the intention has been to cover the union of parameters, but some may be missing, or forgotten to be passed to the underlying models.

@jnothman

This comment has been minimized.

Copy link
Member

@jnothman jnothman commented Nov 26, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.