Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

optimismBoot error #706

Closed
Weekend-Warrior opened this issue Aug 6, 2017 · 19 comments
Closed

optimismBoot error #706

Weekend-Warrior opened this issue Aug 6, 2017 · 19 comments

Comments

@Weekend-Warrior
Copy link

Weekend-Warrior commented Aug 6, 2017

I'm getting an error in the nominalTrainWorkflow. .export in the foreach loop of result is looking for an object called 'optimismBoot', assigned just before the loop but no object exists. Is there a missing condition?

@topepo
Copy link
Owner

topepo commented Aug 6, 2017

Please read the issue template. Providing a reproducible example and the results of sessionInfo will help get your question answered.

@Weekend-Warrior
Copy link
Author

Sure Max, thanks. I apologize for the breach of etiquette.

@topepo
Copy link
Owner

topepo commented Aug 19, 2017

I'm putting together a CRAN submission, so if you have an example to send, sooner is better than later.

@topepo topepo closed this as completed Aug 19, 2017
@alanocallaghan
Copy link

alanocallaghan commented Sep 11, 2017

I have run into this problem also. I believe it is related to the use of parallel backends.

library(caret)
library(doParallel)
library(glmnet)

set.seed(100)

cl <- makeCluster(2)
registerDoParallel(cl)

predictor_matrix <- matrix(rnorm(10000), ncol=200, 
    dimnames=list(NULL, paste("column", 1:200)))
labels <- factor(sample(1:0, nrow(predictor_matrix), replace=TRUE))

tctl <- trainControl(
    method = "repeatedcv",
    number = 5,
    repeats = 10,
    allowParallel = TRUE
)

fit1 <- caret::train(
    x = predictor_matrix,
    y = labels,
    method = "glmnet",
    family = "binomial",
    trControl = tctl
)

Output:

Error in e$fun(obj, substitute(ex), parent.frame(), e$data) : 
  unable to find variable "optimismBoot"
sessionInfo()
R version 3.4.1 (2017-06-30)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 16.04.3 LTS

Matrix products: default
BLAS: /usr/lib/openblas-base/libblas.so.3
LAPACK: /usr/lib/libopenblasp-r0.2.18.so

locale:
 [1] LC_CTYPE=en_GB.UTF-8       LC_NUMERIC=C               LC_TIME=en_GB.UTF-8        LC_COLLATE=en_GB.UTF-8    
 [5] LC_MONETARY=en_GB.UTF-8    LC_MESSAGES=en_GB.UTF-8    LC_PAPER=en_GB.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C             LC_MEASUREMENT=en_GB.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] parallel  stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] glmnet_2.0-10      Matrix_1.2-11      doParallel_1.0.10  iterators_1.0.8    foreach_1.4.3      caret_6.0-77      
[7] ggplot2_2.2.1.9000 lattice_0.20-35    devtools_1.13.3   

loaded via a namespace (and not attached):
 [1] Rcpp_0.12.12       ddalpha_1.2.1      gower_0.1.2        bindr_0.1          compiler_3.4.1     DEoptimR_1.0-8    
 [7] plyr_1.8.4         class_7.3-14       tools_3.4.1        rpart_4.1-11       ipred_0.9-6        digest_0.6.12     
[13] lubridate_1.6.0    memoise_1.1.0      tibble_1.3.3       nlme_3.1-131       gtable_0.2.0       pkgconfig_2.0.1   
[19] rlang_0.1.1        RcppRoll_0.2.2     prodlim_1.6.1      bindrcpp_0.2       e1071_1.6-8        withr_2.0.0       
[25] stringr_1.2.0      dplyr_0.7.2        recipes_0.1.0      stats4_3.4.1       nnet_7.3-12        CVST_0.2-1        
[31] grid_3.4.1         glue_1.1.1         robustbase_0.92-7  R6_2.2.2           survival_2.41-3    lava_1.5          
[37] purrr_0.2.3        reshape2_1.4.2     kernlab_0.9-25     magrittr_1.5       DRR_0.0.2          splines_3.4.1     
[43] scales_0.4.1.9002  codetools_0.2-15   ModelMetrics_1.1.0 MASS_7.3-47        assertthat_0.2.0   dimRed_0.1.0      
[49] timeDate_3012.100  colorspace_1.3-2   stringi_1.1.5      lazyeval_0.2.0     munsell_0.4.3    

@topepo
Copy link
Owner

topepo commented Sep 11, 2017

I can reproduce it. I'll look into it.

@topepo topepo reopened this Sep 11, 2017
topepo added a commit that referenced this issue Sep 11, 2017
@topepo
Copy link
Owner

topepo commented Sep 11, 2017

That should fix the issue. Please retest and check on your system.

@alanocallaghan
Copy link

Works fine for me now, thanks for the quick fix!

@topepo topepo closed this as completed Sep 12, 2017
@bvvamsik
Copy link

I am still having this issue and still getting the error
Error in e$fun(obj, substitute(ex), parent.frame(), e$data) :
unable to find variable "optimismBoot"

@YinanZheng
Copy link

Same problem here as @bvvamsik . Using latest 6.0.77. I also still can reproduce the problem using the @alanocallaghan posted above.

@alanocallaghan
Copy link

Are you guys running the github version or the CRAN version? The latest CRAN version was pushed before this was fixed.

@Triamus
Copy link

Triamus commented Sep 23, 2017

Installing from GitHub via devtools::install_github('topepo/caret/pkg/caret') solved it for me.

@bvvamsik
Copy link

"GitHub Installation" Worked perfectly for me too, hope we will get that CRAN repo update as well, which might help us while scaling our machine learning algorithms..

@garycai
Copy link

garycai commented Oct 24, 2017

After installing caret from github, I still ran into this problem when using the recipes packages:

library(caret)
library(doParallel)
library(glmnet)
library(recipes)

set.seed(100)

cl <- makeCluster(2)
registerDoParallel(cl)

test_data <- as.data.frame(matrix(rnorm(10000), ncol=200, 
                                  dimnames=list(NULL, paste("column", 1:200))))
test_data$label <- factor(sample(1:0, nrow(test_data), replace=TRUE))

data_recipe <- recipe(label ~ ., data = test_data) %>%
    step_center(all_predictors()) %>%
    step_scale(all_predictors())

tctl <- trainControl(
    method = "repeatedcv",
    number = 5,
    repeats = 10,
    allowParallel = TRUE
)

fit1 <- caret::train(
    x = data_recipe,
    data = test_data,
    method = "glmnet",
    family = "binomial",
    trControl = tctl
)

Output
Error in e$fun(obj, substitute(ex), parent.frame(), e$data) : unable to find variable "optimism_boot"

@tomehta
Copy link

tomehta commented Nov 13, 2017

Any idea when the fix will be committed to CRAN ? I am getting the same error while trying parallel processing with caret

@YinanZheng
Copy link

@tomehta @garycai I am using R 3.4.2 and installing from github devtools::install_github('topepo/caret/pkg/caret') works pretty well for me... I had an impression that CRAN update will be around December.

@topepo
Copy link
Owner

topepo commented Nov 13, 2017

I'm shooting for this week.

@caa25
Copy link

caa25 commented Nov 19, 2017

Ran into exact same problem today (11/19/17). Triggered devtools::install_github('topepo/caret/pkg/caret'). Works like a charm. Thanks all.

@topepo
Copy link
Owner

topepo commented Nov 19, 2017

@tomehta @alanocallaghan @bvvamsik

FYI... A new version has been sent to CRAN but a problem with a reverse dependency is holding it up. I've contacted the package owner but have not heard back. I'll give it a few more days then ask them to let it through.

@mbeekink
Copy link

@topepo Thank you for solving the issue. Although the improved version is still nog available through CRAN (28/11/2017). When do you think it will be available?

cauldnz added a commit to cauldnz/doAzureParallel that referenced this issue May 2, 2018
Fixes Azure#260
1. Installs the Batch packages from Github and forces re-install
2. Installs caret from Github due to topepo/caret#706
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants