ModelOriented / ingredients

Effects and Importances of Model Ingredients
https://modeloriented.github.io/ingredients/
GNU General Public License v3.0
37 stars 19 forks source link

Error in ceteris_paribus.default(x, data, predict_function = predict_function, : promise already under evaluation: recursive default argument reference or earlier problems? #49

Closed o1iv3r closed 5 years ago

o1iv3r commented 5 years ago

Trying to run the demo code (below) gives me this error

set.seed(1313)
titanic_small <- titanic[sample(1:nrow(titanic), 500), c(1,2,3,6,7,9)]

model_titanic_glm <- glm(survived == "yes" ~ gender + age + fare + class + sibsp,
                         data = titanic_small, family = "binomial")

explain_titanic_glm <- DALEX::explain(model_titanic_glm,
                               data = titanic_small[,-6],
                               y = titanic_small$survived == "yes",
                               label = "glm")

new_observations <- titanic_small[1:4,-6]
rownames(new_observations) <- c("Lisa", "James", "Thomas", "Nancy")

ceteris_paribus <<- ingredients::ceteris_paribus
dime::modelStudio(explain_titanic_glm,
            new_observations,
            facet_dim = c(2,2), N = 200, B = 20, time = 0)

This is my session:

> sessionInfo()
R version 3.6.1 (2019-07-05)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows Server x64 (build 14393)

Matrix products: default

locale:
[1] LC_COLLATE=English_United States.1252  LC_CTYPE=English_United States.1252    LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C                           LC_TIME=English_United States.1252    

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

other attached packages:
[1] DALEX_0.4.4 dime_0.1.1 

loaded via a namespace (and not attached):
 [1] Rcpp_1.0.2        compiler_3.6.1    pillar_1.4.2      ingredients_0.3.3 prettyunits_1.0.2 remotes_2.1.0     tools_3.6.1      
 [8] testthat_2.1.1    digest_0.6.20     pkgbuild_1.0.3    pkgload_1.0.2     memoise_1.1.0     tibble_2.1.3      gtable_0.3.0     
[15] pkgconfig_2.0.2   rlang_0.4.0       cli_1.1.0         rstudioapi_0.10   curl_3.3          dplyr_0.8.3       withr_2.1.2      
[22] desc_1.2.0        fs_1.3.1          devtools_2.1.0    tidyselect_0.2.5  rprojroot_1.3-2   grid_3.6.1        glue_1.3.1       
[29] R6_2.4.0          processx_3.4.1    sessioninfo_1.1.1 purrr_0.3.2       callr_3.3.1       ggplot2_3.2.0     magrittr_1.5     
[36] backports_1.1.4   scales_1.0.0      ps_1.3.0          usethis_1.5.1     assertthat_0.2.1  colorspace_1.4-1  lazyeval_0.2.2   
[43] munsell_0.5.0     crayon_1.3.4     

Thank you!

hbaniecki commented 5 years ago

Hi! It is already fixed, try to update the package from github:

devtools::install_github("ModelOriented/ingredients")