Skip to content

Commit 6fd481a

Browse files
committed
Update
1 parent a268418 commit 6fd481a

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

R/machine_learning.R

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ feature.selection.boruta <- function(data, iterations = NULL, fix = FALSE, tenta
283283
#' }
284284
#'
285285
#'
286-
compute_k_fold_CV = function(model, k_folds, n_rep, stacking = FALSE, metric = "Accuracy", file_name = NULL, LODO = FALSE,
286+
compute_k_fold_CV = function(train_data, k_folds, n_rep, stacking = FALSE, metric = "Accuracy", file_name = NULL, LODO = FALSE,
287287
ncores = NULL, return = FALSE, fold_construction_fun = NULL,
288288
fold_construction_args_fixed = NULL,
289289
fold_construction_args_tunable = NULL){
@@ -296,19 +296,19 @@ compute_k_fold_CV = function(model, k_folds, n_rep, stacking = FALSE, metric = "
296296
stop("The metric assigned is not supported. Choose either accuracy or AUC.")
297297
}
298298

299-
if(is.null(fold_construction_fun)){ ### Preprocessing (remove collinear variables and low variance)
300-
if(LODO == TRUE){
301-
train_data = preprocess_features(model %>% dplyr::select(-dataset), cor_thresh = 0.9, target_col = "target") %>%
302-
dplyr::mutate(dataset = model$dataset)
303-
}else{
304-
train_data = preprocess_features(model, cor_thresh = 0.9, target_col = "target")
305-
}
306-
}else{
307-
train_data = model
308-
}
309-
310-
rm(model) #Clean memory
311-
gc()
299+
# #if(is.null(fold_construction_fun)){ ### Preprocessing (remove collinear variables and low variance)
300+
# if(LODO == TRUE){
301+
# train_data = preprocess_features(model %>% dplyr::select(-dataset), cor_thresh = 0.9, target_col = "target") %>%
302+
# dplyr::mutate(dataset = model$dataset)
303+
# }else{
304+
# train_data = preprocess_features(model, cor_thresh = 0.9, target_col = "target")
305+
# }
306+
# # }else{
307+
# # train_data = model
308+
# # }
309+
310+
#rm(model) #Clean memory
311+
#gc()
312312

313313
######### Machine Learning models
314314

0 commit comments

Comments
 (0)