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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

lightgbm early_stopping_rounds parameter on fit method is deprecated. #3559

Closed
Redix8 opened this issue Sep 6, 2023 · 2 comments
Closed
Labels

Comments

@Redix8
Copy link

Redix8 commented Sep 6, 2023

馃悰 Bug

GBDTModel fit method has early_stopping_rounds parameter, but latest lightGBM (v4.0.0) has no parameter of it.
now it's using callbacks for early_stopping_rounds.

To Reproduce

Steps to reproduce the behavior:

import deepchem as dc
from lightgbm import LGBMRegressor

lgb = LGBMRegressor()
model = dc.models.GBDTModel(lgb)
model.fit(train_dataset)

File [.venv\lib\site-packages\deepchem\models\gbdt_models\gbdt_model.py:107, in GBDTModel.fit(self, dataset)
104 # Find optimal n_estimators based on original learning_rate and early_stopping_rounds
105 X_train, X_test, y_train, y_test = train_test_split(
106 X, y, test_size=0.2, random_state=seed, stratify=stratify)
--> 107 self.model.fit(
108 X_train,
109 y_train,
110 early_stopping_rounds=self.early_stopping_rounds,
111 eval_metric=self.eval_metric,
112 eval_set=[(X_test, y_test)])
114 # retrain model to whole data using best n_estimators * 1.25
115 if self.model.class.name.startswith('XGB'):

TypeError: LGBMRegressor.fit() got an unexpected keyword argument 'early_stopping_rounds'

Expected behavior

working as lightGBM(v3.3.5)

Environment

  • OS: Windows
  • Python version: 3.10
  • DeepChem version: 2.7.1
  • RDKit version (optional):
  • TensorFlow version (optional):
  • PyTorch version (optional):
  • Any other relevant information:

Additional context

requirements on official document mentioned lightGBM version as "latest"
it need to be fixed to "v3.3.5" for current(v2.7.1 or before) version of deepchem
and maybe more implementation with callbacks for future version of deepchem

@Redix8 Redix8 changed the title lightgbm early_stopping_rounds is deprecated. lightgbm early_stopping_rounds parameter on fit method is deprecated. Sep 6, 2023
@rbharath rbharath added the bug label Sep 15, 2023
@rbharath
Copy link
Member

Thanks for the report! I've marked this as a bug we should fix

@shreyasvinaya
Copy link
Member

@rbharath can we close this issue, it is fixed now

@rbharath rbharath closed this as completed Mar 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants