From 078a5fa88294876ec8f7f4cefd1a37a1c4b9bdf3 Mon Sep 17 00:00:00 2001 From: James Lamb Date: Thu, 9 Nov 2023 11:01:41 -0600 Subject: [PATCH] Apply suggestions from code review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: José Morales --- R-package/R/lgb.cv.R | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/R-package/R/lgb.cv.R b/R-package/R/lgb.cv.R index 70901a3ff2d2..11768c5bfa0b 100644 --- a/R-package/R/lgb.cv.R +++ b/R-package/R/lgb.cv.R @@ -387,7 +387,7 @@ lgb.cv <- function(params = list() }) # Prepare collection of evaluation results - merged_msg <- .lgb_merge_cv_result( + merged_msg <- .merge_cv_result( msg = msg , showsd = showsd ) @@ -476,7 +476,7 @@ lgb.cv <- function(params = list() y <- label[rnd_idx] y <- as.factor(y) - folds <- .lgb_stratified_folds(y = y, k = nfold) + folds <- .stratified_folds(y = y, k = nfold) } else { @@ -528,7 +528,7 @@ lgb.cv <- function(params = list() # It was borrowed from caret::createFolds and simplified # by always returning an unnamed list of fold indices. #' @importFrom stats quantile -.lgb_stratified_folds <- function(y, k) { +.stratified_folds <- function(y, k) { # Group the numeric data based on their magnitudes # and sample within those groups. @@ -594,7 +594,7 @@ lgb.cv <- function(params = list() return(out) } -.lgb_merge_cv_result <- function(msg, showsd) { +.merge_cv_result <- function(msg, showsd) { if (length(msg) == 0L) { stop("lgb.cv: size of cv result error")