I would like to generate progress printing while running a parallel back-end with the caret package.
Same question and solution here, yet the solution does not work for me, any help would be appreciated: r package caret-Print iteration when using parallel
Version info is the same as linked above.
R version 3.3.3 (2017-03-06)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 7 x64 (build 7601) Service Pack 1
other attached packages:
[1] randomForest_4.6-12 doSNOW_1.0.14 snow_0.4-2 plyr_1.8.4 gbm_2.1.3 survival_2.41-3
[7] caret_6.0-76 ggplot2_2.2.1 lattice_0.20-34 doParallel_1.0.10 iterators_1.0.8 foreach_1.4.3
Solution that does not work:
library(doSNOW)
library(caret)
cl <- makeCluster(2, outfile="")
registerDoSNOW(cl)
iris <- iris[1:100,]
iris$Species <- as.factor(as.character(iris$Species))
tc <- trainControl(method="LGOCV", summaryFunction=twoClassSummary, classProb=T,verboseIter=TRUE)
train.rf <- train(Species ~ .,data=iris, method="rf", trControl=tc, metric = "ROC")
Loading required package: randomForest
randomForest 4.6-12
Type rfNews() to see new features/changes/bug fixes.
Attaching package: ‘randomForest’
The following object is masked from ‘package:ggplot2’:
margin
Aggregating results
Selecting tuning parameters
Fitting mtry = 2 on full training set
I also made a modification to the outfile statement in makeCluster to a text file and it did generate a text file in my directory.
cl <- makeCluster(2, outfile="progress.txt")
Is there anyway to work with this to make it print in the R console?
Thank you