Skip to content

Commit

Permalink
Merge branch 'develop' into model-run-workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
meetagrawal09 authored Aug 24, 2024
2 parents 76e5607 + 04c8482 commit d9ae803
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions modules/assim.sequential/R/downscale_function.R
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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))
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit d9ae803

Please sign in to comment.