ModelOriented / modelDown

modelDown generates a website with HTML summaries for predictive models
https://ModelOriented.github.io/modelDown/
118 stars 14 forks source link

module 'auditor' generation failed #86

Open michkam89 opened 2 years ago

michkam89 commented 2 years ago

Hi I'm having problems with generating auditor page. Here's my reproducible example:

library(DALEX)
library(DALEXtra)

library(recipes)
library(workflows)
library(parsnip)

data <- DALEX::titanic_imputed
data$survived <- as.factor(data$survived)
rec <- recipe(survived ~ ., data = data) %>%
  step_normalize(fare)
model <- decision_tree(tree_depth = 25) %>%
  set_engine("rpart") %>%
  set_mode("classification")

wflow <- workflow() %>%
  add_recipe(rec) %>%
  add_model(model)

model_fitted <- wflow %>%
  fit(data = data)

explainer <- DALEXtra::explain_tidymodels(model_fitted, data = titanic_imputed, y = titanic_imputed$survived)
modelDown::modelDown(explainer)

Output from the console:

[1] "Generating auditor..."
[1] "Generating model_performance..."
Saving 7 x 7 in image
Saving 7 x 7 in image
[1] "Generating variable_importance..."

Dołączanie pakietu: ‘kableExtra’

Następujący obiekt został zakryty z ‘package:dplyr’:

    group_rows

Saving 7 x 7 in image
[1] "Generating variable_response..."
'variable_type' changed to 'categorical' due to lack of numerical variables.
Saving 7 x 7 in image
'variable_type' changed to 'categorical' due to lack of numerical variables.
Saving 7 x 7 in image
Saving 7 x 7 in image
Saving 7 x 7 in image
Saving 7 x 7 in image
'variable_type' changed to 'categorical' due to lack of numerical variables.
Saving 7 x 7 in image
Saving 7 x 7 in image
Saving 7 x 7 in image
Warning messages:
1: In value[[3L]](cond) :
  Module 'auditor' generation failed. Skipping it.The detailed error is: Error in xy.coords(x, y, xlabel, ylabel, log): 'x' is a list, but does not have components 'x' and 'y'

My session info:

R version 4.1.2 (2021-11-01)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19042)

Matrix products: default

locale:
[1] LC_COLLATE=Polish_Poland.1250  LC_CTYPE=Polish_Poland.1250    LC_MONETARY=Polish_Poland.1250
[4] LC_NUMERIC=C                   LC_TIME=Polish_Poland.1250    

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

other attached packages:
[1] kableExtra_1.3.4 ggplot2_3.3.5    modelDown_1.1    parsnip_0.1.7    workflows_0.2.4  recipes_0.1.17  
[7] dplyr_1.0.8      DALEXtra_2.2.0   DALEX_2.4.0     

loaded via a namespace (and not attached):
  [1] colorspace_2.0-2   ellipsis_0.3.2     class_7.3-19       rprojroot_2.0.2    fs_1.5.0          
  [6] rstudioapi_0.13    farver_2.1.0       listenv_0.8.0      remotes_2.4.2      ggrepel_0.9.1     
 [11] bit64_4.0.5        prodlim_2019.11.13 fansi_0.5.0        lubridate_1.8.0    xml2_1.3.3        
 [16] codetools_0.2-18   splines_4.1.2      mnormt_2.0.2       cachem_1.0.6       knitr_1.37        
 [21] pkgload_1.2.4      jsonlite_1.8.0     auditor_1.3.3      png_0.1-7          compiler_4.1.2    
 [26] httr_1.4.2         assertthat_0.2.1   Matrix_1.3-4       fastmap_1.1.0      cli_3.1.0         
 [31] htmltools_0.5.2    prettyunits_1.1.1  tools_4.1.2        gtable_0.3.0       glue_1.6.1        
 [36] rappdirs_0.3.3     Rcpp_1.0.8         vctrs_0.3.8        nlme_3.1-153       svglite_2.1.0     
 [41] psych_2.2.3        timeDate_3043.102  gower_0.2.2        xfun_0.29          stringr_1.4.0     
 [46] globals_0.14.0     ps_1.6.0           testthat_3.1.0     rvest_1.0.2        lifecycle_1.0.1   
 [51] devtools_2.4.3     future_1.23.0      MASS_7.3-54        scales_1.2.0       ipred_0.9-12      
 [56] ragg_1.2.2         flock_0.7          parallel_4.1.2     memoise_2.0.1      reticulate_1.24   
 [61] gridExtra_2.3      rpart_4.1-15       stringi_1.7.6      RSQLite_2.2.12     highr_0.9         
 [66] desc_1.4.1         archivist_2.3.6    hnp_1.2-6          hardhat_0.1.6      pkgbuild_1.3.1    
 [71] lava_1.6.10        rlang_1.0.1        pkgconfig_2.0.3    systemfonts_1.0.4  bitops_1.0-7      
 [76] evaluate_0.15      lattice_0.20-45    purrr_0.3.4        labeling_0.4.2     bit_4.0.4         
 [81] tidyselect_1.1.2   processx_3.5.2     parallelly_1.28.1  magrittr_2.0.2     R6_2.5.1          
 [86] generics_0.1.1     DBI_1.1.1          pillar_1.7.0       whisker_0.4        withr_2.5.0       
 [91] survival_3.2-13    RCurl_1.98-1.6     nnet_7.3-16        tibble_3.1.5       future.apply_1.8.1
 [96] crayon_1.5.1       utf8_1.2.2         tmvnsim_1.0-2      rmarkdown_2.11     ingredients_2.2.0 
[101] usethis_2.1.5      grid_4.1.2         blob_1.2.2         callr_3.7.0        digest_0.6.29     
[106] webshot_0.5.3      tidyr_1.2.0        textshaping_0.3.6  munsell_0.5.0      viridisLite_0.4.0 
[111] sessioninfo_1.2.2 

If that can help, I am also having same errors when creating models and explainers from ranger and randomForest directly without tidymodels.

Thanks for any help