I tried this change but I run out of memory 
Iteration 200/4000
Exception in thread "pool-34-thread-1" java.lang.OutOfMemoryError: Java heap space
done building BART in 3.629 sec
evaluating in sample data...Error in .jcall(bart_machine$java_bart_machine, "[[D", "getGibbsSamplesForPrediction", :
java.lang.OutOfMemoryError: GC overhead limit exceeded
In addition: Warning message:
In nominalTrainWorkflow(x = x, y = y, wts = weights, info = trainInfo, :
Error in .jcall(bart_machine$java_bart_machine, "[[D", "getGibbsSamplesForPrediction", :
java.lang.OutOfMemoryError: GC overhead limit exceeded Timing stopped at: 20.77 0.227 4.081
This is the code that is crashing:
library(caret)
library(C50)
library(doParallel)
library(bartMachine)
set_bart_machine_num_cores(1)
cl <- makePSOCKcluster(2)
registerDoParallel(cl)
data(churn)
set.seed(9782)
options(java.parameters = "-Xmx30000m")
# Create train/test indexes -----------------------------------------------
myFolds <- createFolds(churnTrain$churn, k=5)
# My control --------------------------------------------------------------
myControl <- trainControl(
summaryFunction = twoClassSummary,
classProbs = TRUE,
verboseIter = TRUE,
savePredictions = TRUE,
index = myFolds,
search = "random"
)
# BART --------------------------------------------------------------------
# bartGrid <- expand.grid(num_trees = c(10, 15, 20, 100), k = 2, alpha = 0.95, beta = 2, nu = 3)
model_bart <- train(churn ~ .,
churnTrain,
metric = "ROC",
method = "bartMachine",
trControl = myControl,
preProc = c("center", "scale"),
# tuneGrid = bartGrid,
num_burn_in = 2000,
num_iterations_after_burn_in = 2000,
serialize = T)
# stop cluster ------------------------------------------------------------
stopCluster(cl)
plot(model_bart)
Any suggestions?