Hi, I was having the same error "Error: protect(): protection stack overflow" in my code below.
xgb_train <- train(
as.formula(paste(target, "~ .")),
data = train_data,
method = "xgbTree",
trControl = ctrl,
tuneGrid = hyper_grid,
verbose = FALSE,
verbosity = 0,
metric = "RMSE"
)
But I changed to the below given code it worked.
xgb_train <- train(
train_data,
label,
method = "xgbTree",
trControl = ctrl,
tuneGrid = hyper_grid,
verbose = FALSE,
verbosity = 0,
metric = "RMSE"
)
So, the error is because of formula syntax you are using. Enjoy :)
Looks like this is a memory issue. Can you assign more memory to R (or Rstudio if that is what you are using)?
I am working on iMac R terminal and try to use below codes but not resolved the issue.
Many thanks
I also tried this;
env R_MAX_VSIZE=700Gb R
but still getting same error!
What is the size of the data file you are trying to use? While virtual memory can help in some instances it may not be able to avoid limitations of actual RAM you have available.