ltorgo / DMwR2

Functions and data supporting the 2nd edition of the book Data Mining with R by Luis Torgo, published by CRC Press
27 stars 19 forks source link

Chapter 3: Monte Carlo workflow issue #2

Open dataminingintelligence opened 7 years ago

dataminingintelligence commented 7 years ago

Thanks for this second edition of DMwR book.

One of the more exciting parts (I think) is the monte carlo evalutions in chapter 3. My first step is to replicate the data runs from the book. However, I get stuck when executing MC workflow with this error. It feels like a simple error, but I've tried all sort of ways to make it work and I can't see where the missing values should be. Am I the only one in this forum who has got stuck on this part?

PERFORMANCE ESTIMATION USING MONTE CARLO

** PREDICTIVE TASK :: SP500

++ MODEL/WORKFLOW :: earthRegr.v1 Error in if (!missing(cluster) && !is.null(cluster) && getOption("parallelMap.status") == : missing value where TRUE/FALSE needed

DrewMMeister commented 6 years ago

I had the same issue. I am using an old iMac and I found that eliminating the argument for parallel computation at the end of the loop "cluster=TRUE" allowed the code snippet to run without error. Here is what the code looks like with the "cluster=TRUE" eliminated. I warn you that my computer has been doing the Monte Carlo sim for about 20 hours now and is still running....

for(lrn in LEARNERS) { objName <- paste(lrn,"res","regr",sep="_") assign(objName, performanceEstimation(PredTask(Tform,Tdata.train,"SP500"), do.call("workflowVariants", c(list("tradingWF", varsRootName=paste0(lrn,"Regr"), quotes="GSPC", learner=lrn, pred.target="indicator"), VARS[[lrn]], VARS$learning, VARS$trading) ), EST.TASK) # for parallel computation ) save(list=objName,file=paste(objName,'Rdata',sep='.')) }