From 181cf765dc766e8ec6ca425dd22d07a10b32fec5 Mon Sep 17 00:00:00 2001 From: Sambhav Dixit <94298612+sambhavnoobcoder@users.noreply.github.com> Date: Fri, 23 Aug 2024 12:31:59 +0530 Subject: [PATCH] Change create_folds -> .create_folds - Update to the conventional notation --- modules/assim.sequential/R/downscale_function.R | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/assim.sequential/R/downscale_function.R b/modules/assim.sequential/R/downscale_function.R index 54ce13d2e5..a610c718d4 100644 --- a/modules/assim.sequential/R/downscale_function.R +++ b/modules/assim.sequential/R/downscale_function.R @@ -63,7 +63,7 @@ SDA_downscale_preprocess <- function(data_path, coords_path, date, carbon_pool) } ##' @title Create folds function -##' @name create_folds +##' @name .create_folds ##' @author Sambhav Dixit ##' ##' @param y Vector. A vector of outcome data or indices. @@ -76,7 +76,7 @@ SDA_downscale_preprocess <- function(data_path, coords_path, date, carbon_pool) ##' ##' @return A list of k elements (if list = TRUE), each containing indices for a fold, or a vector of indices (if list = FALSE). -create_folds <- function(y, k, list = TRUE, returnTrain = FALSE) { +.create_folds <- function(y, k, list = TRUE, returnTrain = FALSE) { n <- length(y) indices <- seq_len(n) folds <- split(indices, cut(seq_len(n), breaks = k, labels = FALSE)) @@ -184,7 +184,7 @@ SDA_downscale <- function(preprocessed, date, carbon_pool, covariates, model_typ all_models <- list() # Create k-fold indices - fold_indices <- create_folds(y = seq_len(nrow(x_train)), k = k_folds, list = TRUE, returnTrain = FALSE) + fold_indices <- .create_folds(y = seq_len(nrow(x_train)), k = k_folds, list = TRUE, returnTrain = FALSE) #initialise operations for each fold for (fold in 1:k_folds) {