Open nikolase90 opened 5 years ago
I am getting a bit worried that every time we make a change to shap or explain functions, we have to re-create the test objects (explanation_explain_obj.rds and similar) which compares the results of the previous run to pass the tests. That means we don't have a good test for this. This is especially dangerous if one does many changes in the same PR (although we seldom do that).
My suggestion is to add a seperate test that checks only the shapley values from the different test models. We could run a lapply call to the ex_list, extract only the data.table with the shapley values, and then do a testthat::expect_known_value or testthat::expect_known_object on that. What do you think @nikolase90 ? Or is there a better option?
@martinju I think that sounds like a good way to do it.
If you're working on one of these files, please add the url to your branch or the pull request. Mark the box if the changes are merged with
master
.R-files
clustering.R
explanation.R
#128features.R
https://github.com/NorskRegnesentral/shapr/pull/70observations.R
https://github.com/NorskRegnesentral/shapr/pull/95plot.R
https://github.com/NorskRegnesentral/shapr/pull/86predictions.R
https://github.com/NorskRegnesentral/shapr/pull/109sampling.R
https://github.com/NorskRegnesentral/shapr/pull/92shapley.R
#128transformation.R
https://github.com/NorskRegnesentral/shapr/pull/77utils.R
Currently there are zero functions inR/utils.R
.models.R
https://github.com/NorskRegnesentral/shapr/pull/129src-files
AICc.cpp
distance.cpp
impute_data.cpp
https://github.com/NorskRegnesentral/shapr/pull/78weighted_matrix.cpp
https://github.com/NorskRegnesentral/shapr/pull/73The following files should not be tested
R/shapr-package.R
R/zzz.R