Skip to content
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

Update the imports #377

Closed
wants to merge 183 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
183 commits
Select commit Hold shift + click to select a range
87dc45d
Add torch modules
LHBO Dec 20, 2023
a62e3c1
Add vaeac method
LHBO Dec 20, 2023
5976911
Vignettes
LHBO Dec 20, 2023
7683954
VAEAC tests
LHBO Dec 20, 2023
d9660ee
Plot tests
LHBO Dec 20, 2023
1c495cd
vaeac setup tests
LHBO Dec 20, 2023
cf64c85
Add vaeac to explain
LHBO Dec 20, 2023
4c4b128
Add vaeac to explain_forecast
LHBO Dec 20, 2023
673d182
Added plot function that plots several explanations at the same time
LHBO Dec 20, 2023
8fef07e
Added missing `data.table::` in plot function
LHBO Dec 20, 2023
a5b9b04
Refactored `plot_SV_several_approaches`
LHBO Dec 20, 2023
8abd92a
Fixed vignette where `$MSEv_bar` was no longer needed.
LHBO Dec 20, 2023
c1db340
stylr
LHBO Dec 20, 2023
63e659d
Fixed such that can plot explanations even when using different combi…
LHBO Dec 21, 2023
0c29399
Updated references
LHBO Dec 21, 2023
26cf176
Added example file to show how to use `plot_SV_several_approaches()`
LHBO Dec 21, 2023
ea62fca
Updated examples
LHBO Dec 21, 2023
e6aa28d
Added tests
LHBO Dec 21, 2023
0d148f8
skip_connection_masked_enc_dec
LHBO Dec 21, 2023
5d66600
mask_gen_these_coalitions_prob
LHBO Dec 21, 2023
41796f0
mask_gen_these_coalitions
LHBO Dec 21, 2023
5a4fe94
extra_params_skip_con_mask_enc
LHBO Dec 21, 2023
54a5fc6
num_train_param
LHBO Dec 21, 2023
30f1921
stylr
LHBO Dec 21, 2023
e404b22
vaeac.num_different_vaeac_initiate
LHBO Dec 21, 2023
47ffc46
transform_all_cont_features
LHBO Dec 21, 2023
7917b56
exp_trans_cont_features_func
LHBO Dec 21, 2023
a777f58
categorical_parse_params_col
LHBO Dec 21, 2023
65977bb
GaussCatSamplerMostLikely
LHBO Dec 21, 2023
7e79e14
GaussCat
LHBO Dec 21, 2023
368f88c
Specified_prob_mask_generator
LHBO Dec 21, 2023
b91092f
vaeac.save_every_nth_epoch
LHBO Dec 21, 2023
944841d
main_para_in_unknown_para
LHBO Dec 21, 2023
04b2cf3
plot_vaeac_training_evaluation
LHBO Dec 21, 2023
10e97a4
return_train_validation_errors
LHBO Dec 21, 2023
92a8cb9
lintr
LHBO Dec 21, 2023
e189620
return_as_postprocessed_dt
LHBO Dec 21, 2023
e72133e
x_explain_NaNs_preprocessed
LHBO Dec 21, 2023
c6deda2
x_explain_NaNs_preproc_norm
LHBO Dec 21, 2023
58fdb29
figure_facet_for
LHBO Dec 21, 2023
2c39e44
refactored plot_several_vaeacs_VLB_IWAE
LHBO Dec 21, 2023
fe3df70
stylr
LHBO Dec 21, 2023
efd1ec5
Updated manuals
LHBO Dec 21, 2023
514d763
Removed commented out code
LHBO Dec 21, 2023
0166c05
Update description
LHBO Dec 21, 2023
8d3e54a
Fixed errors in vaeac vignette
LHBO Dec 21, 2023
7dae837
num_vaeacs_initiate
LHBO Dec 21, 2023
5e04442
vignette fix
LHBO Dec 21, 2023
9d26701
Typo
LHBO Dec 21, 2023
8ecf45b
updating mse plot. Not sure why the old ones where used here
martinju Jan 2, 2024
a914db7
vaeac test files + Lars as author
martinju Jan 2, 2024
fefcbf4
apply make.names to get safe files names also on windows
martinju Jan 2, 2024
325c7dd
set saving folder to current folder to ensure reproducability
martinju Jan 2, 2024
4001949
library(shapr) in vignette
martinju Jan 2, 2024
076d368
make vignette run
martinju Jan 3, 2024
628e6f0
installs torch for RMCD check
martinju Jan 3, 2024
a73c72a
textit->code + too long file names
martinju Jan 3, 2024
0094338
NSE warnings
martinju Jan 4, 2024
ae50345
try torch install env variable + temporary reduce OS runs
martinju Jan 4, 2024
e7d798e
fix NSE warnings
martinju Jan 4, 2024
c489aa6
remove unused documented arguments
martinju Jan 4, 2024
1969b91
temporary disable vignette chunk running for faster building
martinju Jan 4, 2024
8adedec
man
martinju Jan 4, 2024
b9bed9b
collecting used internal arugments on the top of vaeac prepare function
martinju Jan 5, 2024
364d849
clear out unnecessary stuff
martinju Jan 5, 2024
82d0296
minor edits
martinju Jan 5, 2024
87937e4
minor edit to tests
martinju Jan 8, 2024
411418f
Removed Martin's comments
LHBO Jan 18, 2024
eb13c45
Moved timing of vaeac training
LHBO Jan 18, 2024
cc6726c
Update gitignore
LHBO Jan 18, 2024
66e9539
Removed use of MASS library
LHBO Jan 18, 2024
e0d6afb
Updated `plot_vaeac_training_evaluation` call to the right function.
LHBO Jan 18, 2024
c6d396e
Roxygen
LHBO Jan 18, 2024
f406922
Updated NAMESPACE
LHBO Jan 22, 2024
cbb79a8
Fixed modifyList
LHBO Jan 22, 2024
f689805
Made long example comments shorter (i.e. over two lines)
LHBO Jan 22, 2024
1d69038
Updated all the manuals
LHBO Jan 22, 2024
53456f3
Merge master into branch
LHBO Jan 22, 2024
bc9aa9b
Removed requireNamespace(data.table) as data.table is part of shapr
LHBO Jan 22, 2024
bf6e699
stylr + lintr
LHBO Jan 22, 2024
e3b5c0a
Introduced `vaeac.save_model" parameter to help testing
LHBO Jan 22, 2024
13922ba
lintr
LHBO Jan 22, 2024
e09902c
extra comma
LHBO Jan 22, 2024
4fb6a2f
vaeac test files update
martinju Jan 23, 2024
ae082f8
testplots updated
martinju Jan 23, 2024
dca5e15
Updated stuff
LHBO Jan 23, 2024
fc19887
manuals
LHBO Jan 24, 2024
7c27355
Added vaeac as a factor approach
LHBO Jan 24, 2024
2a2c340
Updated namespace
LHBO Jan 24, 2024
97cd1e9
Added verbose option in explain_forecast
LHBO Jan 24, 2024
f7e3408
added verbose option to explain(). NOT DONE
LHBO Jan 24, 2024
5055c98
Manuals
LHBO Jan 24, 2024
174207c
Roxygen
LHBO Jan 24, 2024
04ed31e
Added verbose to shapr
LHBO Jan 24, 2024
f3421d2
Working on approach_vaeac
LHBO Jan 24, 2024
910d9c5
Folders and filename is now being set in setup
LHBO Jan 24, 2024
6c3bac1
Commented out code that that is no longer needed for save folder + mo…
LHBO Jan 24, 2024
3c2fa7a
Added separate vaeac check functions
LHBO Jan 25, 2024
65c06cd
changed from training_data to `x_train`
LHBO Jan 25, 2024
8c84d3b
Changed from preprocessed_data to x_train_preprocessed
LHBO Jan 25, 2024
9b4a864
Vaeac cuda check + changed check functions to not return anything
LHBO Jan 25, 2024
31cec0c
Before changing progress
LHBO Jan 26, 2024
0b20c9c
Halfway done with refactoring vaeac training
LHBO Jan 26, 2024
d421146
Weekend
LHBO Jan 26, 2024
4fa16d1
Moved a lot of vaeac check functions to separate file
LHBO Jan 26, 2024
bf185f1
Continue with early stopping
LHBO Jan 26, 2024
98ff517
Updated manuals
LHBO Jan 29, 2024
dc70afb
vaeac_train_model_auxiliary
LHBO Jan 29, 2024
4486a7a
The initial training function works
LHBO Jan 29, 2024
b950b88
Removed R_vaeac as class
LHBO Jan 29, 2024
a34a8b0
Manuals
LHBO Jan 30, 2024
e4684e3
Working on prepare_data
LHBO Jan 30, 2024
2e420fc
Changed where vaeac.save_model is stored
LHBO Jan 31, 2024
5a7e5a4
Need to fix vignette
LHBO Feb 1, 2024
721d841
Updated extra functions
LHBO Feb 1, 2024
fc4ec3a
Started to work on continue train
LHBO Feb 1, 2024
2ef3a95
Changed filenames and fixed roxygen
LHBO Feb 1, 2024
11d12dd
Removed @ from roxygen in torch modules
LHBO Feb 1, 2024
e02c241
Changed names 1
LHBO Feb 2, 2024
9070649
Changed names 2
LHBO Feb 2, 2024
62570e1
Gone from `num` to `n`.
LHBO Feb 2, 2024
7aa13cd
Removed `GaussCatSampler` as it was not used.
LHBO Feb 2, 2024
811aa86
Small comment changes
LHBO Feb 2, 2024
d6ee335
Added that we keep the verbose in explain
LHBO Feb 2, 2024
d34c217
Finished `vaeac_plot_imputed_ggpairs`
LHBO Feb 3, 2024
246f7b2
Fixed verbose levels, some name changes, checked that log_exp_cont_fe…
LHBO Feb 3, 2024
483c1b6
Deleted vaeac_exp_trans_cont_features and vaeac_log_trans_cont_featur…
LHBO Feb 3, 2024
0516c96
Fixed comments
LHBO Feb 3, 2024
a8fedc6
stylr
LHBO Feb 3, 2024
ec13743
Fixed verbose level prepare data
LHBO Feb 3, 2024
2ad460a
Fixed logical error in `vaeac_extend_batch`
LHBO Feb 3, 2024
2505823
Updated examples in `vaeac_plot_evaluation_criteria`
LHBO Feb 3, 2024
91d618d
Updated manuals
LHBO Feb 3, 2024
8f3aa25
Checked that progressr works as intended
LHBO Feb 3, 2024
6598ba0
Moved plot functions
LHBO Feb 3, 2024
25ea590
stylr + lintr
LHBO Feb 3, 2024
ff4955f
Fixed logical error in parameters
LHBO Feb 3, 2024
a550763
Fixed roxygen and made sure that whole vignette works
LHBO Feb 4, 2024
3e65c80
Fixed todo notes and main vignette
LHBO Feb 4, 2024
f05be64
Both vignettes work
LHBO Feb 4, 2024
36322e8
styler
LHBO Feb 4, 2024
4deee32
Updated manuals and files to pass checks (global var and stuff)
LHBO Feb 4, 2024
be3672b
Checked that all `vaeac` tests run
LHBO Feb 4, 2024
120aee8
Styler
LHBO Feb 4, 2024
3ca0ad6
Moved vaeac extra functions to same file.
LHBO Feb 4, 2024
be41d5c
Forgot to remove comments
LHBO Feb 4, 2024
09a3033
Fixes #322 + new printout format on GH
martinju Feb 15, 2024
59096b5
Merge branch 'fix_dt_update' into Lars/VAEAC_SHAPR
martinju Feb 15, 2024
c317234
removed keyword internal
martinju Feb 15, 2024
0e9d773
update docs
martinju Feb 15, 2024
c350892
update test files
martinju Feb 15, 2024
87f1a53
accept also vaeac tests
martinju Feb 15, 2024
7abd4d8
Started shapr vaeac vignette skip build. Need to change its filename …
LHBO Feb 15, 2024
0ef4b65
Test if it works now
LHBO Feb 15, 2024
1f120f7
to run properly on GHA which only have 4 cores
martinju Feb 16, 2024
dbf01e5
Merge branch 'Lars/VAEAC_SHAPR' of github.com:LHBO/shapr into Lars/VA…
martinju Feb 16, 2024
72db0d8
fix long names in vignette cache, remove formalArgs ++
martinju Feb 16, 2024
b1fdd58
move long running vignette script out of R/
martinju Feb 16, 2024
bb2a85a
.
martinju Feb 16, 2024
10fb862
actually run the chunks in the vignettes
martinju Feb 16, 2024
68fb88d
vignette figures + more name fixing
martinju Feb 16, 2024
25db7b3
gitignore vignette cache. Will do it manually locally anyway
martinju Feb 16, 2024
cd0df49
more vignette file updates
martinju Feb 16, 2024
5d28b8a
put the original vignette into the long-vignette format as well
martinju Feb 16, 2024
4a3b4aa
fix typo making tests on GHA fail
martinju Feb 16, 2024
7e5bec3
forgot to update rds files
martinju Feb 16, 2024
70a3048
Added main vignette to the .Rbuildignore file too
LHBO Feb 16, 2024
b7a85b3
Added vignettes figure and cache map to buildignore
LHBO Feb 16, 2024
4060144
Updated what to remove from shapr object when not saving vaeac model.…
LHBO Feb 16, 2024
93311fa
Updated questions before publising on cran
LHBO Feb 16, 2024
b61ac8f
Updated snapshots for vaeac test functions
LHBO Feb 16, 2024
96e87a0
Set separate figure and cache paths for the vignettes
LHBO Feb 16, 2024
4ce7e98
Updated broken links in vaeac vignette
LHBO Feb 16, 2024
31baa9c
Updated the figure parameters
LHBO Feb 16, 2024
6be1ee0
Run the vignettes and deleted old files
LHBO Feb 16, 2024
e4e1b58
stylr
LHBO Feb 16, 2024
f5f0d69
Put all stats imports on one line
LHBO Feb 19, 2024
48ed1bb
Removed model.frame
LHBO Feb 19, 2024
922edc0
removed rect
LHBO Feb 19, 2024
c5a1e5c
Updating rbuildignore
LHBO Feb 19, 2024
034dea2
Figuring out what imports to remove
LHBO Feb 19, 2024
6b0237d
Get the same check results as before removing imports, so everything …
LHBO Feb 19, 2024
c13c68c
lintr
LHBO Feb 19, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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/*$
15 changes: 12 additions & 3 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,10 @@ jobs:
fail-fast: false
matrix:
config:
- {os: macOS-latest, r: 'release'}
- {os: windows-latest, r: 'release'}
- {os: ubuntu-20.04, r: 'devel', http-user-agent: 'release'}
# Temporary disable all but ubuntu release to reduce compute while debugging
# - {os: macOS-latest, r: 'release'}
# - {os: windows-latest, r: 'release'}
# - {os: ubuntu-20.04, r: 'devel', http-user-agent: 'release'}
- {os: ubuntu-20.04, r: 'release'}
# Temporary disable the below check plattforms as they fail due to a change in how R reports error from R<4.3 to R>=4.3,
# which gives a different output in the snapshots produced by testthat>=3.2.0
Expand All @@ -49,6 +50,9 @@ jobs:
R_KEEP_PKG_SOURCE: yes

steps:
- name: Set the value
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
12 changes: 9 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -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
21 changes: 10 additions & 11 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,32 +72,27 @@ export(rss_cpp)
export(setup)
export(setup_approach)
export(setup_computation)
export(vaeac_continue_train_model)
export(vaeac_get_evaluation_criteria)
export(vaeac_get_extra_para_default)
export(vaeac_plot_evaluation_criteria)
export(vaeac_plot_imputed_ggpairs)
export(vaeac_train_model)
export(weight_matrix_cpp)
importFrom(Rcpp,sourceCpp)
importFrom(data.table,":=")
importFrom(data.table,as.data.table)
importFrom(data.table,between)
importFrom(data.table,copy)
importFrom(data.table,data.table)
importFrom(data.table,fread)
importFrom(data.table,fwrite)
importFrom(data.table,is.data.table)
importFrom(data.table,month)
importFrom(data.table,rbindlist)
importFrom(data.table,setcolorder)
importFrom(data.table,setkey)
importFrom(data.table,setnames)
importFrom(data.table,uniqueN)
importFrom(data.table,year)
importFrom(graphics,hist)
importFrom(graphics,plot)
importFrom(graphics,rect)
importFrom(stats,as.formula)
importFrom(stats,contrasts)
importFrom(stats,embed)
importFrom(stats,formula)
importFrom(stats,model.frame)
importFrom(stats,model.matrix)
importFrom(stats,predict)
importFrom(stats,pt)
importFrom(stats,qt)
Expand All @@ -103,5 +101,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
Loading