From 08d1ce4bbf9391f5cc945f5f015840f4a57774a6 Mon Sep 17 00:00:00 2001 From: James Lamb Date: Mon, 10 May 2021 09:10:48 -0500 Subject: [PATCH] [docs] clarify docs for LGBM_BoosterGetEvalNames and LGBM_BoosterGetEvalCounts (fixes #4264) (#4270) --- include/LightGBM/c_api.h | 12 ++++++------ python-package/lightgbm/basic.py | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/include/LightGBM/c_api.h b/include/LightGBM/c_api.h index 57713ba1be2b..025633c97bde 100644 --- a/include/LightGBM/c_api.h +++ b/include/LightGBM/c_api.h @@ -575,24 +575,24 @@ LIGHTGBM_C_EXPORT int LGBM_BoosterNumberOfTotalModel(BoosterHandle handle, int* out_models); /*! - * \brief Get number of evaluation datasets. + * \brief Get number of evaluation metrics. * \param handle Handle of booster - * \param[out] out_len Total number of evaluation datasets + * \param[out] out_len Total number of evaluation metrics * \return 0 when succeed, -1 when failure happens */ LIGHTGBM_C_EXPORT int LGBM_BoosterGetEvalCounts(BoosterHandle handle, int* out_len); /*! - * \brief Get names of evaluation datasets. + * \brief Get names of evaluation metrics. * \param handle Handle of booster * \param len Number of ``char*`` pointers stored at ``out_strs``. * If smaller than the max size, only this many strings are copied - * \param[out] out_len Total number of evaluation datasets + * \param[out] out_len Total number of evaluation metrics * \param buffer_len Size of pre-allocated strings. * Content is copied up to ``buffer_len - 1`` and null-terminated * \param[out] out_buffer_len String sizes required to do the full string copies - * \param[out] out_strs Names of evaluation datasets, should pre-allocate memory + * \param[out] out_strs Names of evaluation metrics, should pre-allocate memory * \return 0 when succeed, -1 when failure happens */ LIGHTGBM_C_EXPORT int LGBM_BoosterGetEvalNames(BoosterHandle handle, @@ -633,7 +633,7 @@ LIGHTGBM_C_EXPORT int LGBM_BoosterGetNumFeature(BoosterHandle handle, /*! * \brief Get evaluation for training data and validation data. * \note - * 1. You should call ``LGBM_BoosterGetEvalNames`` first to get the names of evaluation datasets. + * 1. You should call ``LGBM_BoosterGetEvalNames`` first to get the names of evaluation metrics. * 2. You should pre-allocate memory for ``out_results``, you can get its length by ``LGBM_BoosterGetEvalCounts``. * \param handle Handle of booster * \param data_idx Index of data, 0: training data, 1: 1st validation data, 2: 2nd validation data and so on diff --git a/python-package/lightgbm/basic.py b/python-package/lightgbm/basic.py index 1f59280188af..eaddfff442a9 100644 --- a/python-package/lightgbm/basic.py +++ b/python-package/lightgbm/basic.py @@ -3452,7 +3452,7 @@ def __get_eval_info(self): ctypes.byref(out_num_eval))) self.__num_inner_eval = out_num_eval.value if self.__num_inner_eval > 0: - # Get name of evals + # Get name of eval metrics tmp_out_len = ctypes.c_int(0) reserved_string_buffer_size = 255 required_string_buffer_size = ctypes.c_size_t(0)