From 2067bdc5b4b402bd129afc9aea9bd1ee2732f412 Mon Sep 17 00:00:00 2001 From: Nikita Titov Date: Fri, 27 Aug 2021 03:22:48 +0300 Subject: [PATCH] [docs][python] Improve description of `eval_result` argument in `record_evaluation()` (#4559) * Update callback.py * Update engine.py --- python-package/lightgbm/callback.py | 8 +++++--- python-package/lightgbm/engine.py | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/python-package/lightgbm/callback.py b/python-package/lightgbm/callback.py index 7189954ffc20..0585d889c7d1 100644 --- a/python-package/lightgbm/callback.py +++ b/python-package/lightgbm/callback.py @@ -78,7 +78,9 @@ def record_evaluation(eval_result: Dict[str, Dict[str, List[Any]]]) -> Callable: Parameters ---------- eval_result : dict - A dictionary to store the evaluation results. + Dictionary used to store all evaluation results of all validation sets. + This should be initialized outside of your call to ``record_evaluation()`` and should be empty. + Any initial contents of the dictionary will be deleted. Returns ------- @@ -157,9 +159,9 @@ def early_stopping(stopping_rounds: int, first_metric_only: bool = False, verbos Parameters ---------- stopping_rounds : int - The possible number of rounds without the trend occurrence. + The possible number of rounds without the trend occurrence. first_metric_only : bool, optional (default=False) - Whether to use only the first metric for early stopping. + Whether to use only the first metric for early stopping. verbose : bool, optional (default=True) Whether to print message with early stopping information. diff --git a/python-package/lightgbm/engine.py b/python-package/lightgbm/engine.py index 0d278b21fc49..ab9cfde7551c 100644 --- a/python-package/lightgbm/engine.py +++ b/python-package/lightgbm/engine.py @@ -124,7 +124,7 @@ def train( evals_result: dict or None, optional (default=None) Dictionary used to store all evaluation results of all the items in ``valid_sets``. This should be initialized outside of your call to ``train()`` and should be empty. - Any initial contents of the dictionary will be deleted by ``train()``. + Any initial contents of the dictionary will be deleted. .. rubric:: Example