Skip to content

Commit

Permalink
Remove deprecated arguments of lgb.train
Browse files Browse the repository at this point in the history
  • Loading branch information
lijm1358 committed Jan 7, 2024
1 parent 8678d84 commit 80bc095
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions supervised/tuner/optuna/lightgbm.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,16 +139,17 @@ def __call__(self, trial):
pruning_callback = optuna.integration.LightGBMPruningCallback(
trial, metric_name, "validation"
)
early_stopping_callback = lgb.early_stopping(
self.early_stopping_rounds, verbose=False
)

gbm = lgb.train(
param,
self.dtrain,
valid_sets=[self.dvalid],
valid_names=["validation"],
verbose_eval=False,
callbacks=[pruning_callback],
callbacks=[pruning_callback, early_stopping_callback],
num_boost_round=self.rounds,
early_stopping_rounds=self.early_stopping_rounds,
feval=self.custom_eval_metric,
)

Expand Down

0 comments on commit 80bc095

Please sign in to comment.