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 forward some fixed arguments to LGBMClassifier? #33

Closed
leonleeann opened this issue May 26, 2023 · 3 comments
Closed

How to forward some fixed arguments to LGBMClassifier? #33

leonleeann opened this issue May 26, 2023 · 3 comments

Comments

@leonleeann
Copy link

I'm using verstack.LGBMTuner to optimize params of a lightgbm.LGBMClassifier, that should resolve a multiclass classification problem.

My trouble is that the dataset is heavily imbalanced, so I need pass an argument class_weight='balanced' to LGBMClassifier's constructor.

I read the docs of LGBMTuner, but I didn't find any hint about how to forwarding parameters to a potential estimator.

Is there a way I can do it?

@DanilZherebtsov
Copy link
Owner

DanilZherebtsov commented Jun 12, 2023

Hi @leonleeann

Thank you for your comment. I've had this feature request quite a few times by now and just shipped the update.

pip install --upgrade verstack

You should get a verstack.version == 3.8.0 and LGBMTuner.version == 1.1.0

Now you can pass any supported LGBM parameters at init as follows:

from verstack import LGBMTuner

my_custom_params = {'class_weight' : 'balanced'}

tuner = LGBMTuner(metric = 'accuracy', custom_lgbm_params = my_custom_params)

It is all reflected in the documentation.

@leonleeann
Copy link
Author

Thank you @DanilZherebtsov !
Sorry, maybe I refered an outdated doc.

@DanilZherebtsov
Copy link
Owner

Thank you @DanilZherebtsov !
Sorry, maybe I refered an outdated doc.

No, you were right. I just shipped the update today. Let me know if it works.

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