Unverified Commit 0ffd2a3a authored by Oliver Borchert's avatar Oliver Borchert Committed by GitHub
Browse files

[python-package] Fix mypy checks in `engine.py` (#6900)



* [python-package] Fix mypy checks in `engine.py`

* Update python-package/lightgbm/engine.py

---------
Co-authored-by: default avatarJames Lamb <jaylamb20@gmail.com>
parent 0df10887
...@@ -341,7 +341,9 @@ def train( ...@@ -341,7 +341,9 @@ def train(
) )
except callback.EarlyStopException as earlyStopException: except callback.EarlyStopException as earlyStopException:
booster.best_iteration = earlyStopException.best_iteration + 1 booster.best_iteration = earlyStopException.best_iteration + 1
evaluation_result_list = earlyStopException.best_score # eval results from cv() have a 5th element with the standard deviation of metrics,
# which is not needed for early stopping
evaluation_result_list = [item[:4] for item in earlyStopException.best_score]
break break
booster.best_score = defaultdict(OrderedDict) booster.best_score = defaultdict(OrderedDict)
for dataset_name, eval_name, score, _ in evaluation_result_list: for dataset_name, eval_name, score, _ in evaluation_result_list:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment