diff --git a/R/cross_validation.R b/R/cross_validation.R index 19c8868..ad845ab 100644 --- a/R/cross_validation.R +++ b/R/cross_validation.R @@ -327,8 +327,6 @@ fn_cv_1 = function(i, list_merged, df_params, mat_idx_shuffle, vec_set_partition #' using the sommer R package (https://www.ncbi.nlm.nih.gov/pmc/articles/PMC4894563/). #' https://link.springer.com/protocol/10.1007/978-1-62703-447-0_13 #' @param max_mem_Gb maximum memory in gigabytes available for computation (Default=15) -#' @param bool_across_pop for across population cross-validation? This will use a data size multiplier of 40 if true, -#' otherwise a multiplier of 10 will be used for within population cross-validation (Default=TRUE) #' @param verbose show cross-validation parameter preparation messages? (Default=FALSE) #' @returns #' - Ok: @@ -356,7 +354,7 @@ fn_cv_1 = function(i, list_merged, df_params, mat_idx_shuffle, vec_set_partition #' @export fn_cross_validation_preparation = function(list_merged, cv_type=1, n_folds=10, n_reps=10, vec_models_to_test=c("ridge","lasso","elastic_net","Bayes_A","Bayes_B","Bayes_C","gBLUP"), - max_mem_Gb=15, bool_across_pop=TRUE, verbose=FALSE) + max_mem_Gb=15, verbose=FALSE) { ################################################### ### TEST @@ -420,18 +418,12 @@ fn_cross_validation_preparation = function(list_merged, cv_type=1, n_folds=10, n df_params = df_params[order(df_params$rep), ] df_params = df_params[order(df_params$fold), ] ### Estimate the maximum number of threads which can be used without running out of memory - if (bool_across_pop) { - memory_multiplier = 40 - } else { - memory_multiplier = 10 - } list_mem = fn_estimate_memory_footprint( X=list_merged, n_models=length(vec_models_to_test), n_folds=n_folds, n_reps=n_reps, memory_requested_Gb=max_mem_Gb, - memory_multiplier=memory_multiplier, verbose=verbose) } else if (cv_type == 2) { ############################################ @@ -701,7 +693,6 @@ fn_cross_validation_within_population = function(list_merged, n_folds=10, n_reps n_reps=n_reps, vec_models_to_test=vec_models_to_test, max_mem_Gb=max_mem_Gb, - bool_across_pop=FALSE, verbose=verbose) if (methods::is(list_cv_params, "gpError")) { error = chain(list_cv_params, methods::new("gpError", diff --git a/R/io.R b/R/io.R index 60396fc..8ce6712 100644 --- a/R/io.R +++ b/R/io.R @@ -2376,7 +2376,6 @@ fn_estimate_memory_footprint = function(X, n_models=7, n_folds=10, n_reps=10, size_total = size_X * n_models * n_folds * n_reps * memory_multiplier n_threads = floor(as.numeric(gsub(" bytes", "", size_RAM / (size_X * memory_multiplier)))) if (verbose) { - print(paste0("Dimensions of G: = ", paste(dim(X$G), collapse=" x "))) print(paste0("Size of X: = ", format(size_X, units="b"))) print(paste0("n_models = ", n_models, "; n_folds = ", n_folds, "; n_reps = ", n_reps)) print(paste0("Total memory requested = ",