thomasp85 / lime

Local Interpretable Model-Agnostic Explanations (R port of original Python package)
https://lime.data-imaginist.com/
Other
481 stars 109 forks source link

explain example does not work #111

Closed Toniiiio closed 5 years ago

Toniiiio commented 6 years ago

I tried to run the example of the explain function: (installed the development version of the package from github).

library(MASS)
iris_test <- iris[1, 1:4]
iris_train <- iris[-1, 1:4]
iris_lab <- iris[[5]][-1]
model <- lda(iris_train, iris_lab)
explanation <- lime(iris_train, model)

# This can now be used together with the explain method
explain(iris_test, explanation, n_labels = 1, n_features = 2)
#> Error in coefs[1, 1] : invalid or not-yet-implemented 'Matrix' subsetting

Session info:

> sessionInfo() R version 3.4.2 (2017-09-28) 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_US.UTF-8       LC_NUMERIC=C               LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8      [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8    LC_PAPER=en_US.UTF-8       LC_NAME=C                   [9] LC_ADDRESS=C               LC_TELEPHONE=C             LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C         attached base packages: [1] stats     graphics  grDevices utils     datasets  methods   base       other attached packages: [1] MASS_7.3-47       shinythemes_1.1.1 shiny_1.1.0       stringi_1.2.3     pacman_0.4.6      lime_0.4.0.9999    loaded via a namespace (and not attached):  [1] Rcpp_0.12.17       compiler_3.4.2     later_0.7.3        git2r_0.19.0       gower_0.1.2        plyr_1.8.4          [7] iterators_1.0.9    tools_3.4.2        digest_0.6.12      memoise_1.1.0      tibble_1.3.4       gtable_0.2.0       [13] lattice_0.20-35    rlang_0.2.1        Matrix_1.2-11      foreach_1.4.4      parallel_3.4.2     curl_3.0           [19] yaml_2.1.14        withr_2.0.0        httr_1.3.1         knitr_1.17         htmlwidgets_1.2    devtools_1.13.3    [25] glmnet_2.0-16      grid_3.4.2         R6_2.2.2           ggplot2_2.2.1      magrittr_1.5       scales_0.5.0       [31] codetools_0.2-15   promises_1.0.1     htmltools_0.3.6    stringdist_0.9.5.1 assertthat_0.2.0   mime_0.5           [37] colorspace_1.3-2   xtable_1.8-2       httpuv_1.4.4.1     lazyeval_0.2.0     munsell_0.4.3
--
 
> | >
>
thomasp85 commented 5 years ago

I cannot reproduce - is this still a problem?

Toniiiio commented 5 years ago

sry i didnt see/get the notifier back then. The error does not appear anymore.