Skip to content

Commit 6862162

Browse files
[python-package] [docs] Update key format of eval_hist in docstring example (#5980)
1 parent 04b66e0 commit 6862162

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

python-package/lightgbm/engine.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -651,13 +651,18 @@ def cv(
651651
652652
Returns
653653
-------
654-
eval_hist : dict
655-
Evaluation history.
654+
eval_results : dict
655+
History of evaluation results of each metric.
656656
The dictionary has the following format:
657-
{'metric1-mean': [values], 'metric1-stdv': [values],
658-
'metric2-mean': [values], 'metric2-stdv': [values],
657+
{'valid metric1-mean': [values], 'valid metric1-stdv': [values],
658+
'valid metric2-mean': [values], 'valid metric2-stdv': [values],
659659
...}.
660660
If ``return_cvbooster=True``, also returns trained boosters wrapped in a ``CVBooster`` object via ``cvbooster`` key.
661+
If ``eval_train_metric=True``, also returns the train metric history.
662+
In this case, the dictionary has the following format:
663+
{'train metric1-mean': [values], 'valid metric1-mean': [values],
664+
'train metric2-mean': [values], 'valid metric2-mean': [values],
665+
...}.
661666
"""
662667
if not isinstance(train_set, Dataset):
663668
raise TypeError(f"cv() only accepts Dataset object, train_set has type '{type(train_set).__name__}'.")

0 commit comments

Comments
 (0)