0

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

StupidWolf
  • 45,075
  • 17
  • 40
  • 72
  • 2
    nothing to do with seed. can you show what your data is like? see https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example – StupidWolf Nov 27 '20 at 21:23
  • Hello, I have 78/215=36% response. Total sample size of training dataset=215. I have 23 variables half characters and half zscores. some variable have only 4 yes vs 211 no. Dependant variable is factor. Does this help you to help me ? and none of my variables are missing. – Manon Girard Nov 29 '20 at 19:56
  • Do you think it is because my number of repeats is too high vs datapoints (i.e. I am doing 50 repeats of a sample of 215 observations....I have been testing several thing since 2 weeks going nowhere... – Manon Girard Nov 29 '20 at 21:27
  • please read this https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example. Point is no one knows what your data looks like and please don't describe them in the comments like this. Edit your question – StupidWolf Nov 29 '20 at 21:30

0 Answers0