From 742723be1c0b4b690186aa75425b5e5fe633f6ae Mon Sep 17 00:00:00 2001 From: James Lamb Date: Wed, 16 Feb 2022 08:45:36 -0600 Subject: [PATCH] [docs] clarify that custom eval functions are not only used on training data --- python-package/lightgbm/basic.py | 2 +- python-package/lightgbm/engine.py | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/python-package/lightgbm/basic.py b/python-package/lightgbm/basic.py index b3c6788fef57..8dfb6d113cce 100644 --- a/python-package/lightgbm/basic.py +++ b/python-package/lightgbm/basic.py @@ -3151,7 +3151,7 @@ def eval(self, data, name, feval=None): If ``fobj`` is specified, predicted values are returned before any transformation, e.g. they are raw margin instead of probability of positive class for binary task in this case. eval_data : Dataset - The evaluation dataset. + A ``Dataset`` to evaluate. eval_name : str The name of evaluation function (without whitespace). eval_result : float diff --git a/python-package/lightgbm/engine.py b/python-package/lightgbm/engine.py index 0d3c4b58543f..3b3bd9c4566f 100644 --- a/python-package/lightgbm/engine.py +++ b/python-package/lightgbm/engine.py @@ -83,7 +83,7 @@ def train( If ``fobj`` is specified, predicted values are returned before any transformation, e.g. they are raw margin instead of probability of positive class for binary task in this case. eval_data : Dataset - The training dataset. + A ``Dataset`` to evaluate. eval_name : str The name of evaluation function (without whitespaces). eval_result : float @@ -429,15 +429,15 @@ def cv(params, train_set, num_boost_round=100, feval : callable, list of callable, or None, optional (default=None) Customized evaluation function. - Each evaluation function should accept two parameters: preds, train_data, + Each evaluation function should accept two parameters: preds, eval_data, and return (eval_name, eval_result, is_higher_better) or list of such tuples. preds : numpy 1-D array The predicted values. If ``fobj`` is specified, predicted values are returned before any transformation, e.g. they are raw margin instead of probability of positive class for binary task in this case. - train_data : Dataset - The training dataset. + eval_data : Dataset + A ``Dataset`` to evaluate. eval_name : str The name of evaluation function (without whitespace). eval_result : float