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

ValueError in example_simulated.py #34

Open
Naviden opened this issue Jan 24, 2020 · 3 comments
Open

ValueError in example_simulated.py #34

Naviden opened this issue Jan 24, 2020 · 3 comments

Comments

@Naviden
Copy link

Naviden commented Jan 24, 2020

Hi, running example_simulated.py gives the following error:

/Users/navid/opt/anaconda3/envs/rulefit-venv/bin/python "/Users/navid/Google Drive/PhD/Repositories/XAI-2016/rulefit/example_simulated.py"
/Users/navid/opt/anaconda3/envs/rulefit-venv/lib/python3.7/site-packages/sklearn/linear_model/_coordinate_descent.py:472: ConvergenceWarning: Objective did not converge. You might want to increase the number of iterations. Duality gap: 0.4675243067167685, tolerance: 0.4523666850279077
  tol, rng, random, positive)
/Users/navid/opt/anaconda3/envs/rulefit-venv/lib/python3.7/site-packages/sklearn/linear_model/_coordinate_descent.py:476: ConvergenceWarning: Objective did not converge. You might want to increase the number of iterations. Duality gap: 5.518840165506575, tolerance: 0.6706225710160342
  positive)
Traceback (most recent call last):
  File "/Users/navid/Google Drive/PhD/Repositories/XAI-2016/rulefit/example_simulated.py", line 25, in <module>
    rf.fit(X.values, y)
  File "/Users/navid/Google Drive/PhD/Repositories/XAI-2016/rulefit/rulefit/rulefit.py", line 398, in fit
    self.tree_generator.fit(np.copy(X, order='C'), np.copy(y, order='C'))
  File "/Users/navid/opt/anaconda3/envs/rulefit-venv/lib/python3.7/site-packages/sklearn/ensemble/_gb.py", line 1523, in fit
    self.estimators_.shape[0]))
ValueError: n_estimators=1 must be larger or equal to estimators_.shape[0]=560 when warm_start==True
@CoteDave
Copy link

Got the same error, i try to disable warm_start = False but same problem! It happens when I run the model twice. The first time is ok than this error when i run the model again

@davidgibsonp
Copy link

I am also seeing this error. I re-ran everything and it works. Fine for my use case but tuning has become tedious.

@Anpr1211
Copy link

Anpr1211 commented Apr 8, 2020

When you run the RuleFit with any tree generator, after fitting the model, the value of the parameter n_estimators gets changed to 1, and hence we face this issue.

If you initialise the RuleFit again before fitting and specify n_estimators, it seems to work.

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

4 participants