Skip to content

Commit 313d346

Browse files
committed
fixes for number of observations in model survshap
1 parent 0f6bf31 commit 313d346

File tree

4 files changed

+9
-6
lines changed

4 files changed

+9
-6
lines changed

R/model_survshap.R

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ model_survshap <- function(explainer, ...) {
5959
model_survshap.surv_explainer <- function(explainer,
6060
new_observation = NULL,
6161
y_true = NULL,
62+
N = NULL,
6263
calculation_method = "kernelshap",
6364
aggregation_method = "integral",
6465
output_type = "survival",
@@ -98,6 +99,7 @@ model_survshap.surv_explainer <- function(explainer,
9899
explainer = explainer,
99100
new_observation = observations,
100101
output_type = output_type,
102+
N = N,
101103
y_true = y_true,
102104
calculation_method = calculation_method,
103105
aggregation_method = aggregation_method

R/surv_shap.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,8 @@ surv_shap <- function(explainer,
102102
# to display final object correctly, when is.matrix(new_observation) == TRUE
103103
res$variable_values <- as.data.frame(new_observation)
104104
res$result <- switch(calculation_method,
105-
"exact_kernel" = use_exact_shap(explainer, new_observation, output_type, ...),
106-
"kernelshap" = use_kernelshap(explainer, new_observation, output_type, ...),
105+
"exact_kernel" = use_exact_shap(explainer, new_observation, output_type, N, ...),
106+
"kernelshap" = use_kernelshap(explainer, new_observation, output_type, N, ...),
107107
"treeshap" = use_treeshap(explainer, new_observation, ...),
108108
stop("Only `exact_kernel`, `kernelshap` and `treeshap` calculation methods are implemented"))
109109
# quality-check here

man/model_survshap.surv_explainer.Rd

Lines changed: 4 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/surv_shap.Rd

Lines changed: 1 addition & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)