Skip to content

Commit

Permalink
Adding the VAEAC approach (#369)
Browse files Browse the repository at this point in the history
  • Loading branch information
LHBO authored Mar 5, 2024
1 parent 97d5691 commit ab26e0b
Show file tree
Hide file tree
Showing 202 changed files with 14,791 additions and 246 deletions.
7 changes: 7 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,10 @@ inst/compare_lundberg\.xgb\.obj
^CRAN-SUBMISSION$
^.Rprofile
^python$
^rebuild-long-running-vignette\.R$
^vignettes/understanding_shapr_vaeac\.Rmd\.orig$
^vignettes/understanding_shapr\.Rmd\.orig$
^vignettes/figure_main/*$
^vignettes/cache_main/*$
^vignettes/figure_vaeac/*$
^vignettes/cache_vaeac/*$
9 changes: 9 additions & 0 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ jobs:
R_KEEP_PKG_SOURCE: yes

steps:
- name: Set the value
shell: bash # Default on non-Windows, but needs to be specfied for this to run on Windows
run: echo "TORCH_INSTALL=1" >> "$GITHUB_ENV"

- uses: actions/checkout@v2

- uses: r-lib/actions/setup-pandoc@v2
Expand All @@ -64,6 +68,11 @@ jobs:
extra-packages: any::rcmdcheck
needs: check

# Try to do this with the env variable TORCH_INSTALL instead to hopefully get setup-r-dependencies to cache the installation
# - name: Install torch dependencies
# run: torch::install_torch()
# shell: Rscript {0}

- uses: r-lib/actions/check-r-package@v2
with:
args: 'c("--no-manual")' # I.e. exclude the as-cran comment here
Expand Down
2 changes: 1 addition & 1 deletion .lintr
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ linters: linters_with_defaults(
)
exclusions: list(
"inst/scripts",
"vignettes/understanding_shapr.R",
"vignettes",
"R/RcppExports.R",
"R/zzz.R"
)
14 changes: 10 additions & 4 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Package: shapr
Version: 0.2.3.9100
Version: 0.2.3.9200
Title: Prediction Explanation with Dependence-Aware Shapley Values
Description: Complex machine learning models are often hard to interpret. However, in
many situations it is crucial to understand and explain why a model made a specific
Expand All @@ -12,6 +12,7 @@ Description: Complex machine learning models are often hard to interpret. Howeve
Authors@R: c(
person("Nikolai", "Sellereite", email = "[email protected]", role = "aut", comment = c(ORCID = "0000-0002-4671-0337")),
person("Martin", "Jullum", email = "[email protected]", role = c("cre", "aut"), comment = c(ORCID = "0000-0003-3908-5155")),
person("Lars Henry Berge", "Olsen", email = "[email protected]", role = "aut", comment = c(ORCID = "0009-0006-9360-6993")),
person("Annabelle", "Redelmeier", email = "[email protected]", role = "aut"),
person("Jon", "Lachmann", email = "[email protected]", role = "aut"),
person("Anders", "Løland", email = "[email protected]", role = "ctb"),
Expand All @@ -26,14 +27,15 @@ Encoding: UTF-8
LazyData: true
ByteCompile: true
Language: en-US
RoxygenNote: 7.2.3
RoxygenNote: 7.3.1
Depends: R (>= 3.5.0)
Imports:
stats,
data.table,
Rcpp (>= 0.12.15),
Matrix,
future.apply
future.apply,
methods
Suggests:
ranger,
xgboost,
Expand All @@ -51,7 +53,11 @@ Suggests:
future,
ggbeeswarm,
vdiffr,
forecast
forecast,
torch,
GGally,
progress,
coro
LinkingTo:
RcppArmadillo,
Rcpp
Expand Down
10 changes: 10 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ S3method(prepare_data,empirical)
S3method(prepare_data,gaussian)
S3method(prepare_data,independence)
S3method(prepare_data,timeseries)
S3method(prepare_data,vaeac)
S3method(print,shapr)
S3method(setup_approach,categorical)
S3method(setup_approach,combined)
Expand All @@ -43,6 +44,7 @@ S3method(setup_approach,empirical)
S3method(setup_approach,gaussian)
S3method(setup_approach,independence)
S3method(setup_approach,timeseries)
S3method(setup_approach,vaeac)
export(aicc_full_single_cpp)
export(compute_shapley_new)
export(compute_vS)
Expand All @@ -61,6 +63,7 @@ export(hat_matrix_cpp)
export(mahalanobis_distance_cpp)
export(observation_impute_cpp)
export(plot_MSEv_eval_crit)
export(plot_SV_several_approaches)
export(predict_model)
export(prepare_data)
export(prepare_data_copula_cpp)
Expand All @@ -69,6 +72,12 @@ export(rss_cpp)
export(setup)
export(setup_approach)
export(setup_computation)
export(vaeac_get_evaluation_criteria)
export(vaeac_get_extra_para_default)
export(vaeac_plot_eval_crit)
export(vaeac_plot_imputed_ggpairs)
export(vaeac_train_model)
export(vaeac_train_model_continue)
export(weight_matrix_cpp)
importFrom(Rcpp,sourceCpp)
importFrom(data.table,":=")
Expand Down Expand Up @@ -103,5 +112,6 @@ importFrom(stats,sd)
importFrom(stats,setNames)
importFrom(utils,head)
importFrom(utils,methods)
importFrom(utils,modifyList)
importFrom(utils,tail)
useDynLib(shapr, .registration = TRUE)
2 changes: 1 addition & 1 deletion R/approach.R
Original file line number Diff line number Diff line change
Expand Up @@ -82,5 +82,5 @@ insert_defaults <- function(internal, defaults) {

#' @keywords internal
get_factor_approaches <- function() {
c("'independence' (not recommended)", "'ctree'", "'categorical'")
c("'independence' (not recommended)", "'ctree'", "'vaeac'", "'categorical'")
}
Loading

0 comments on commit ab26e0b

Please sign in to comment.