-
Notifications
You must be signed in to change notification settings - Fork 40
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: UQE()
can only be used within a quasiquoted argument
#100
Comments
I tried investigating this and am unable to reproduce this issue. It may be something related to your particular machine/setup. In attempting to reproduce this, I did the following remove.packages(c("sl3", "delayed", "origami", "SuperLearner"))
update.packages(ask=FALSE)
devtools::install_github(c("jeremyrcoyle/sl3", "jeremyrcoyle/origami", "jeremyrcoyle/delayed", "ecpolley/SuperLearner")) Then, I ran the example given directly above ❯ library(sl3)
sl3 1.0.0
Please note the package is in early stages of development. Check often for updates and report bugs at http://github.com/jeremyrcoyle/sl3.
❯ library(origami)
library(SuperLearner)
data(cpp_imputed)
covars <- c("apgar1", "apgar5", "parity", "gagebrth", "mage", "meducyrs", "sexn")
outcome <- "haz"
task <- sl3_Task$new(data.table::copy(cpp_imputed), covariates = covars, outcome = outco
me)
task2 <- sl3_Task$new(data.table::copy(cpp_imputed), covariates = covars, outcome = outc
ome)
glm_learner <- Lrnr_glm$new()
glmnet_learner <- Lrnr_pkg_SuperLearner$new("SL.glmnet")
subset_apgar <- Lrnr_subset_covariates$new(covariates = c("apgar1", "apgar5"))
learners <- list(glm_learner, glmnet_learner, subset_apgar)
sl1 <- make_learner(Lrnr_sl, learners, glm_learner)
sl1_fit <- sl1$train(task)
origami: Generalized Cross-Validation Framework
Version: 0.8.2
Loading required package: nnls
Super Learner
Version: 2.0-23-9000
Package created on 2017-11-07
Loading required package: glmnet
Loading required package: Matrix
Attaching package: ‘Matrix’
The following object is masked from ‘package:tidyr’:
expand
Loading required package: foreach
foreach: simple, scalable parallel programming from Revolution Analytics
Use Revolution R for scalability, fault tolerance and more.
http://www.revolutionanalytics.com
Attaching package: ‘foreach’
The following objects are masked from ‘package:purrr’:
accumulate, when
Loaded glmnet 2.0-13 which yields the following ❯ sl1_fit
[1] "SuperLearner:"
List of 3
$ : chr "Lrnr_glm"
$ : chr "Lrnr_pkg_SuperLearner_SL.glmnet"
$ : chr "Lrnr_subset_covariates_c(\"apgar1\", \"apgar5\")"
[1] "Lrnr_glm"
$coefficients
Lrnr_glm
-0.058447022
Lrnr_pkg_SuperLearner_SL.glmnet
0.994056984
Lrnr_subset_covariates_c("apgar1", "apgar5")_apgar1
0.007251873
Lrnr_subset_covariates_c("apgar1", "apgar5")_apgar5
-0.001111357
intercept
-0.032777920
$R
Lrnr_glm
Lrnr_glm -10.76306
Lrnr_pkg_SuperLearner_SL.glmnet 0.00000
Lrnr_subset_covariates_c("apgar1", "apgar5")_apgar1 0.00000
Lrnr_subset_covariates_c("apgar1", "apgar5")_apgar5 0.00000
intercept 0.00000
Lrnr_pkg_SuperLearner_SL.glmnet
Lrnr_glm -9.850734
Lrnr_pkg_SuperLearner_SL.glmnet -1.275411
Lrnr_subset_covariates_c("apgar1", "apgar5")_apgar1 0.000000
Lrnr_subset_covariates_c("apgar1", "apgar5")_apgar5 0.000000
intercept 0.000000
Lrnr_subset_covariates_c("apgar1", "apgar5")_apgar1
Lrnr_glm -177.20816
Lrnr_pkg_SuperLearner_SL.glmnet -99.51456
Lrnr_subset_covariates_c("apgar1", "apgar5")_apgar1 -215.59712
Lrnr_subset_covariates_c("apgar1", "apgar5")_apgar5 0.00000
intercept 0.00000
Lrnr_subset_covariates_c("apgar1", "apgar5")_apgar5
Lrnr_glm -187.2683
Lrnr_pkg_SuperLearner_SL.glmnet -118.3183
Lrnr_subset_covariates_c("apgar1", "apgar5")_apgar1 -210.2261
Lrnr_subset_covariates_c("apgar1", "apgar5")_apgar5 -104.4910
intercept 0.0000
intercept
Lrnr_glm -22.718235
Lrnr_pkg_SuperLearner_SL.glmnet -16.959897
Lrnr_subset_covariates_c("apgar1", "apgar5")_apgar1 -23.350899
Lrnr_subset_covariates_c("apgar1", "apgar5")_apgar5 -4.689026
intercept 8.366137
$rank
[1] 5
$family
Family: gaussian
Link function: identity
$deviance
[1] 2302.752
$aic
[1] 4776.875
$null.deviance
[1] 2352.594
$iter
[1] 2
$df.residual
[1] 1436
$df.null
[1] 1440
$converged
[1] TRUE
$boundary
[1] FALSE
$linkinv_fun
function (eta)
eta
<environment: namespace:stats>
[1] "Cross-validated risk (MSE, squared error loss):"
learner coefficients mean_risk SE_risk
1: Lrnr_glm -0.058447022 1.600699 0.1044375
2: Lrnr_pkg_SuperLearner_SL.glmnet 0.994056984 1.598497 0.1040675
3: Lrnr_subset_covariates_c("apgar1", "apgar5")_apgar1 0.007251873 59.897271 0.8552774
4: Lrnr_subset_covariates_c("apgar1", "apgar5")_apgar5 -0.001111357 71.151577 0.8560152
5: SuperLearner NA 1.598082 0.1041452
fold_SD fold_min_risk fold_max_risk
1: 0.2898641 1.117885 2.185334
2: 0.2897284 1.107970 2.177785
3: 2.0043825 58.100414 63.126207
4: 2.7441044 65.003838 74.550986
5: 0.2887530 1.111586 2.178588 For completeness, here's a call to ❯ sessionInfo()
R version 3.4.3 (2017-11-30)
Platform: x86_64-apple-darwin17.2.0 (64-bit)
Running under: macOS High Sierra 10.13.1
Matrix products: default
BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libLAPACK.dylib
locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] glmnet_2.0-13 foreach_1.4.3 Matrix_1.2-12
[4] SuperLearner_2.0-23-9000 nnls_1.4 origami_0.8.2
[7] sl3_1.0.0 forcats_0.2.0 stringr_1.3.0
[10] dplyr_0.7.4 purrr_0.2.4 readr_1.1.1
[13] tidyr_0.7.2 tibble_1.3.4 ggplot2_2.2.1
[16] tidyverse_1.2.1 devtools_1.13.4 nima_0.4.5
[19] fcuk_0.1.21 prettycode_1.0.0 colorout_1.1-2
[22] prompt_1.0.0
loaded via a namespace (and not attached):
[1] httr_1.3.1 jsonlite_1.5 modelr_0.1.1 gtools_3.5.0
[5] assertthat_0.2.0 cellranger_1.1.0 globals_0.10.3 backports_1.1.1
[9] lattice_0.20-35 glue_1.2.0 uuid_0.1-2 digest_0.6.12
[13] checkmate_1.8.5 rvest_0.3.2 colorspace_1.3-2 htmltools_0.3.6
[17] plyr_1.8.4 psych_1.7.8 clisymbols_1.2.0 pkgconfig_2.0.1
[21] broom_0.4.3 listenv_0.6.0 haven_1.1.0 scales_0.5.0
[25] stringdist_0.9.4.6 withr_2.1.0 lazyeval_0.2.1 cli_1.0.0
[29] mnormt_1.5-5 magrittr_1.5 crayon_1.3.4 readxl_1.0.0
[33] memoise_1.1.0 future_1.6.2 delayed_0.2.1 nlme_3.1-131
[37] xml2_1.1.1 foreign_0.8-69 ggthemes_3.4.0 tools_3.4.3
[41] data.table_1.10.5 hms_0.4.0 BBmisc_1.11 ProjectTemplate_0.8
[45] munsell_0.4.3 bindrcpp_0.2 compiler_3.4.3 rlang_0.1.4
[49] grid_3.4.3 iterators_1.0.8 rstudioapi_0.7 htmlwidgets_0.9
[53] visNetwork_2.0.1 igraph_1.1.2 gtable_0.2.0 codetools_0.2-15
[57] abind_1.4-5 reshape2_1.4.2 R6_2.2.2 gridExtra_2.3
[61] lubridate_1.7.1 bindr_0.1 stringi_1.1.6 rstackdeque_1.1.1
[65] parallel_3.4.3 Rcpp_0.12.14 |
I also can't seem to reproduce this bug. To give you some idea where to look, |
Thanks for this guys! Indeed, the problem was with rlang, reinstalling it completely took care of everything. |
After installing the latest versions of sl3/delayed/origami, every attempt to train a super learner in sl3 crashes and burns on my system. Not sure why its running fine on travis. Any ideas / clues where to look?
This is just running one of the tests from https://github.com/jeremyrcoyle/sl3/blob/f40c784d56e603b2b9df41b5edef0b801fb2df66/tests/testthat/test_sl.R#L4-L21
The error is the same regardless of what code I run.
The text was updated successfully, but these errors were encountered: