超出了BART开销限制

时间:2018-10-01 23:41:45

标签: r r-caret bartmachine

我正在尝试学习如何将BART与caret一起使用,并且遇到以下错误:

library(caret)
library(C50)
library(doParallel)
cl <- makePSOCKcluster(10)
registerDoParallel(cl)
data(churn)
set.seed(9782)

# Create train/test indexes -----------------------------------------------
myFolds <- createFolds(churnTrain$churn, k=5)
# My control --------------------------------------------------------------
myControl <- trainControl(
  summaryFunction = twoClassSummary,
  classProbs = TRUE,
  verboseIter = TRUE,
  savePredictions = TRUE,
  index = myFolds
)

# BART --------------------------------------------------------------------
bartGrid <- expand.grid(num_trees = c(500, 1000), 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)



 Error in .jcall(bart_machine$java_bart_machine, "[[D", "getGibbsSamplesForPrediction",  : 
  java.lang.OutOfMemoryError: GC overhead limit exceeded 

我在做什么错了?

0 个答案:

没有答案