CODE:
seedx=12345
set.seed(seedx)
train_control1 <- trainControl(method="repeatedcv", number=5, repeats=50, savePredictions="final", classProbs=TRUE, summaryFunction=twoClassSummary)
train_control1$sampling<-"smote"
set.seed(seedx);
rfxmod <- train(vardep~., data = training, method ='rf', metric='ROC', trControl =train_control1)
I am having the following error:
Error in { : task 1 failed - "3 arguments passed to 'is.nan' which requires 1" Calls: train ... train.default -> nominalTrainWorkflow -> %op% -> Execution halted
traceback()
8: stop(simpleError(msg, call = expr))
7: e$fun(obj, substitute(ex), parent.frame(), e$data)
6: foreach(iter = seq(along = resampleIndex), .combine = "c", .verbose = FALSE,
.export = export, .packages = "caret") %:% foreach(parm = 1L:nrow(info$loop),
.combine = "c", .verbose = FALSE, .export = export, .packages = "caret") %op%
{
if (!(length(ctrl$seeds) == 1 && is.na(ctrl$seeds)))
set.seed(ctrl$seeds[[iter]][parm])
loadNamespace("caret")
I tested different seed/folds/repeats still same error. I also re-installed the latest R software. I tested the same dataset and same code with another PC and it works.
Does anyone have any idea? I think the problem is the seeds. But I don't seem to able to rule it out. It does it even with XGBTREE and GLMNET. I also created my own multifolds/tunegrid and seeds and still not working.
Thanks