Skip to content

Commit

Permalink
fixing checks NSE + documentation (not properly)
Browse files Browse the repository at this point in the history
  • Loading branch information
martinju committed Aug 2, 2024
1 parent 73780af commit 829db34
Show file tree
Hide file tree
Showing 10 changed files with 51 additions and 3 deletions.
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ importFrom(stats,as.formula)
importFrom(stats,contrasts)
importFrom(stats,embed)
importFrom(stats,formula)
importFrom(stats,median)
importFrom(stats,model.frame)
importFrom(stats,model.matrix)
importFrom(stats,predict)
Expand Down
12 changes: 12 additions & 0 deletions R/explain.R
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,18 @@
#' Use `0` (default) for no verbosity, `1` for low verbose, and `2` for high verbose.
#' TODO: Make this clearer when we end up fixing this and if they should force a progressr bar.
#'
#' @param paired_shap_sampling TODO: document
#'
#' @param adaptive TODO: document
#'
#' @param n_boot_samps TODO: document
#'
#' @param print_shapleyres TODO: document
#'
#' @param print_iter_info TODO: document
#'
#' @param shapley_reweighting TODO: document
#'
#' @param ... Further arguments passed to specific approaches
#'
#' @inheritDotParams setup_approach.empirical
Expand Down
2 changes: 1 addition & 1 deletion R/finalize_explanation.R
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ bootstrap_shapley <- function(internal,dt_vS,n_boot_samps = 100,seed = 123){

shapley_reweighting(X_boot, reweight=shapley_reweighting) # reweights the shapley weights by reference

W_boot <- shapr:::weight_matrix(
W_boot <- shapr::weight_matrix(
X = X_boot,
normalize_W_weights = TRUE,
is_groupwise = FALSE
Expand Down
4 changes: 4 additions & 0 deletions R/setup_computation.R
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,10 @@ shapley_setup <- function(internal) {
#' @param group_num List. Contains vector of integers indicating the feature numbers for the
#' different groups.
#'
#' @param paired_shap_sampling TODO: document
#'
#' @param prev_feature_samples TODO: document
#'
#' @return A data.table that contains the following columns:
#' \describe{
#' \item{id_combination}{Positive integer. Represents a unique key for each combination. Note that the table
Expand Down
2 changes: 2 additions & 0 deletions R/shapr-package.R
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
#'
#' @importFrom stats rnorm
#'
#' @importFrom stats median
#'
#' @importFrom Rcpp sourceCpp
#'
#' @keywords internal
Expand Down
11 changes: 10 additions & 1 deletion R/zzz.R
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,16 @@
"x_train_torch",
"self",
"..current_comb",
"..regression.response_var"
"..regression.response_var",
"sample_freq",
"features_dup",
"features_dup_tmp",
"maxval",
"minval",
"req_samples",
"explain_id",
"id_combination_new",
"features_str"
)
)

Expand Down
2 changes: 1 addition & 1 deletion man/compute_vS.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions man/explain.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions man/feature_combinations.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions man/setup.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 829db34

Please sign in to comment.