Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Sep 18, 2024
1 parent e49c9f0 commit 830ce79
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions torch_frame/gbdt/tuned_lightgbm.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,7 @@ def objective(

boost = lightgbm.train(
self.params, train_data, num_boost_round=num_boost_round,
valid_sets=[eval_data],
callbacks=[
valid_sets=[eval_data], callbacks=[
lightgbm.early_stopping(stopping_rounds=50, verbose=False),
lightgbm.log_evaluation(period=2000)
])
Expand Down Expand Up @@ -202,14 +201,12 @@ def _tune(

study.optimize(
lambda trial: self.objective(trial, train_data, eval_data,
num_boost_round),
num_trials)
num_boost_round), num_trials)
self.params.update(study.best_params)

self.model = lightgbm.train(
self.params, train_data, num_boost_round=num_boost_round,
valid_sets=[eval_data],
callbacks=[
valid_sets=[eval_data], callbacks=[
lightgbm.early_stopping(stopping_rounds=50, verbose=False),
lightgbm.log_evaluation(period=2000)
])
Expand Down

0 comments on commit 830ce79

Please sign in to comment.