Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[python-package] [docs] Update key format of eval_hist in docstring example #5980

Merged
merged 5 commits into from
Sep 8, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions python-package/lightgbm/engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -651,13 +651,18 @@ def cv(

Returns
-------
eval_hist : dict
Evaluation history.
eval_results : dict
History of evaluation results of each metric.
The dictionary has the following format:
{'metric1-mean': [values], 'metric1-stdv': [values],
'metric2-mean': [values], 'metric2-stdv': [values],
{'valid metric1-mean': [values], 'valid metric1-stdv': [values],
'valid metric2-mean': [values], 'valid metric2-stdv': [values],
...}.
If ``return_cvbooster=True``, also returns trained boosters wrapped in a ``CVBooster`` object via ``cvbooster`` key.
If ``eval_train_metric=True``, also returns the train metric history.
In this case, the dictionary has the following format:
{'train metric1-mean': [values], 'valid metric1-mean': [values],
'train metric2-mean': [values], 'valid metric2-mean': [values],
...}.
"""
if not isinstance(train_set, Dataset):
raise TypeError(f"cv() only accepts Dataset object, train_set has type '{type(train_set).__name__}'.")
Expand Down