Skip to content

Commit

Permalink
Raise error when eval_at is str
Browse files Browse the repository at this point in the history
  • Loading branch information
Alnusjaponica committed Sep 8, 2023
1 parent 80700a3 commit e0f6505
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion optuna/integration/_lightgbm_tuner/optimize.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ def _metric_with_eval_at(self, metric: str) -> str:
)

# Optuna can handle only a single metric. Choose first one.
if isinstance(eval_at, Sequence):
if isinstance(eval_at, (list, tuple)):
return f"{metric}@{eval_at[0]}"
if isinstance(eval_at, int):
return f"{metric}@{eval_at}"
Expand Down

0 comments on commit e0f6505

Please sign in to comment.