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

no support for LGBMRegressor #280

Closed
buus2 opened this issue Oct 26, 2018 · 4 comments
Closed

no support for LGBMRegressor #280

buus2 opened this issue Oct 26, 2018 · 4 comments

Comments

@buus2
Copy link

buus2 commented Oct 26, 2018

Hi,
Although LightGBM is officially supported, in a Jupyter notebook for

lgb_model = lgb.LGBMRegressor()
lgb_model.fit(X, Y)
eli5.explain_weights(lgb_model)

I obtain

Error: estimator LGBMRegressor(boosting_type='gbdt', class_weight=None, colsample_bytree=1.0,
importance_type='split', learning_rate=0.1, max_depth=-1, min_child_samples=20,
min_child_weight=0.001, min_split_gain=0.0, n_estimators=100, n_jobs=-1, num_leaves=31,
objective=None, random_state=12, reg_alpha=0.0, reg_lambda=0.0, silent=True, subsample=1.0,
subsample_for_bin=200000, subsample_freq=0) is not supported

I use LightGBM 2.2.1, eli5 0.8.
@lopuhin What to do?

@buus2
Copy link
Author

buus2 commented Nov 14, 2018

@kmike @lopuhin Friendly reminder about the issue I posted.

@lopuhin
Copy link
Contributor

lopuhin commented Nov 14, 2018

@buus2 at first I thought that this due to missing support for lightgmb booster (which is being fixed in #270), but now I see that you are using scikit-learn API and this should work (and is tested on Travis), it is supported here:

@explain_weights.register(lightgbm.LGBMRegressor)

So I'm not sure how can it happen so far... I checked Travis build and it's using exactly the same version lightgbm==2.2.1: https://travis-ci.org/TeamHG-Memex/eli5/jobs/451009709#L770 and here is the test:

def test_explain_weights_regressor(boston_train):
reg = LGBMRegressor()
_check_rf_regressor(reg, boston_train)

Which python version do you use?

@buus2
Copy link
Author

buus2 commented Nov 16, 2018

I have just tried again and this time it worked perfectly… My current setup is:
Ubuntu 18.04
Python 3.6.6
JupyterLab 0.34.8
LightGBM 2.2.1
eli5 0.8
The apt logs say that during last 3 weeks (after 2018-10-26) I updated Ubuntu and Python:
https://pastebin.com/hVdSAjt7
JupyterLab, LightGBM and eli5 are the same like they were when I opened this thread.

Anyway, since now it works, I think we may close this discussion. Sorry for bothering you and thank you for the nice tool you provide.

@lopuhin
Copy link
Contributor

lopuhin commented Nov 16, 2018

Thanks for persistence and for your kind words @buus2 ! 👍 Closing this.

@lopuhin lopuhin closed this as completed Nov 16, 2018
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

2 participants