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

Error in if (grepl("adaptive", trControl$method) & nrow(tuneGrid) == 1) #1113

Open
5 tasks done
pascaloettli opened this issue Jan 17, 2020 · 1 comment
Open
5 tasks done

Comments

@pascaloettli
Copy link

pascaloettli commented Jan 17, 2020

Trying to use a bartMachine model, the following error appears with caret 6.0-85 but not with caret 6.0-84

Error in if (grepl("adaptive", trControl$method) & nrow(tuneGrid) == 1) { :
argument is of length zero

Minimal, reproducible example:

library(caret)
library(mlbench)
data(BostonHousing)

bartFit <- train(
  medv ~ .,
  data = BostonHousing,
  method = "bartMachine",
  trControl = trainControl(method = "cv")
)

Session Info:

R version 3.6.2 (2019-12-12)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 18.04.3 LTS

Matrix products: default
BLAS/LAPACK: /opt/OpenBLAS/lib/libopenblasp-r0.3.7.so

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

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

other attached packages:
[1] mlbench_2.1-1   caret_6.0-85    ggplot2_3.2.1   lattice_0.20-38 sos_2.0-0       brew_1.0-6     

loaded via a namespace (and not attached):
 [1] bartMachine_1.2.4.2  splines_3.6.2        foreach_1.4.7        carData_3.0-3        prodlim_2019.11.13  
 [6] assertthat_0.2.1     stats4_3.6.2         cellranger_1.1.0     yaml_2.2.0           ipred_0.9-9         
[11] pillar_1.4.3         backports_1.1.5      glue_1.3.1           pROC_1.16.1          digest_0.6.23       
[16] randomForest_4.6-14  colorspace_1.4-1     recipes_0.1.9        htmltools_0.4.0      Matrix_1.2-18       
[21] plyr_1.8.5           timeDate_3043.102    pkgconfig_2.0.3      haven_2.2.0          purrr_0.3.3         
[26] bartMachineJARs_1.1  scales_1.1.0         itertools_0.1-3      openxlsx_4.1.4       gower_0.2.1         
[31] lava_1.6.6           rio_0.5.16           tibble_2.1.3         generics_0.0.2       car_3.0-6           
[36] withr_2.1.2          nnet_7.3-12          lazyeval_0.2.2       survival_3.1-8       magrittr_1.5        
[41] crayon_1.3.4         readxl_1.3.1         evaluate_0.14        nlme_3.1-143         MASS_7.3-51.5       
[46] forcats_0.4.0        foreign_0.8-74       class_7.3-15         tools_3.6.2          data.table_1.12.8   
[51] hms_0.5.3            lifecycle_0.1.0      stringr_1.4.0        munsell_0.5.0        zip_2.0.4           
[56] missForest_1.4       compiler_3.6.2       rlang_0.4.2          grid_3.6.2           iterators_1.0.12    
[61] rstudioapi_0.10      rmarkdown_2.0        gtable_0.3.0         ModelMetrics_1.2.2.1 codetools_0.2-16    
[66] abind_1.4-5          curl_4.3             reshape2_1.4.3       R6_2.4.1             lubridate_1.7.4     
[71] knitr_1.27           dplyr_0.8.3          zeallot_0.1.0        rJava_0.9-11         stringi_1.4.5       
[76] parallel_3.6.2       Rcpp_1.0.3           vctrs_0.2.1          rpart_4.1-15         tidyselect_0.2.5    
[81] xfun_0.12
  • Start a new R session
  • Install the latest version of caret: update.packages(oldPkgs="caret", ask=FALSE)
  • Write a minimal reproducible example
  • Do not use parallel processing in the code (unless you are certain that the issue is about parallel processing).
  • run sessionInfo()
@pascaloettli
Copy link
Author

Same with caret_6.0-86

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

1 participant