From 5973093eeef8936fde68710548e78f886b93c35e Mon Sep 17 00:00:00 2001 From: Toby Dylan Hocking Date: Tue, 16 Jan 2024 21:51:26 -0800 Subject: [PATCH] separate out sample list --- R/ResamplingVariableSizeTrainCV.R | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/R/ResamplingVariableSizeTrainCV.R b/R/ResamplingVariableSizeTrainCV.R index 3cd52d2..f781f69 100644 --- a/R/ResamplingVariableSizeTrainCV.R +++ b/R/ResamplingVariableSizeTrainCV.R @@ -37,9 +37,8 @@ ResamplingVariableSizeTrainCV = R6::R6Class( data.dt <- task$data() data.table(N=nrow(data.dt), row_id=list(1:nrow(data.dt))) }else task$strata - folds = private$.combine( - lapply(strata$row_id, private$.sample, task = task) - )[order(row_id)] + sample.list <- lapply(strata$row_id, private$.sample, task = task) + folds = private$.combine(sample.list)[order(row_id)] min_train_data <- self$param_set$values[["min_train_data"]] if(task$nrow <= min_train_data){ stop(sprintf(