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

How to increase iterations? #48

Open
RicardoFCJ opened this issue Apr 2, 2020 · 3 comments
Open

How to increase iterations? #48

RicardoFCJ opened this issue Apr 2, 2020 · 3 comments

Comments

@RicardoFCJ
Copy link

I'm trying to train the models but it is not converging. I tried to set max_iter in regressor, but it is not recognizing it. This is the warning I'm getting.

ConvergenceWarning: Objective did not converge. You might want to increase the number of iterations. Duality gap: 0.17428639502685428, tolerance: 0.0699999999999999

Should I just wait for it to finish, or, if not, how can I increase iterations?

@natekupp
Copy link
Owner

natekupp commented Apr 5, 2020

Hey @RicardoFCJ - I've seen this a bunch in the past but have never had a chance to debug what's going on. If you have time would love to hear what you learn.

If you grep the codebase for max_iter you can see it's hard-coded to 5000 right now; it may be worth experimenting with that. Also it should certainly not be hard-coded :)

@RicardoFCJ
Copy link
Author

I'm sorry for the delayed response.
(I'm not sure if that's what you're asking with "would love to hear what you learn", but ...)
What I'm trying to learn is a dataset precision agriculture with 50 features and ~700 cases.

@maxiimilian
Copy link
Contributor

I am reviving this, because I have problems with it aswell. If the duality gap is too large, results are really not so good because the optimization did not converge.

A manual fix is to increase max_iter in ffx/core/model_factories.py inside the _pathwiseLearn() function (l. 414).

However, I was thinking of a more permanent solution. Since **fit_params get's passed to _pathwiseLearn() anyway, we could use that dict to drag along max_iter from run() and from the constructor of the FFXRegressor. That would be a bit ugly and difficult to test so I am open to better suggestions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants