@@ -28,7 +28,7 @@ surv_shap <- function(explainer,
2828
2929 # make this code work for multiple observations
3030 stopifnot(
31- " `y_true` must be either a matrix with one per observation in `new_observation` or a vector of length == 2" = ifelse(
31+ " `y_true` must be either a matrix with one row per observation in `new_observation` or a vector of length == 2" = ifelse(
3232 ! is.null(y_true ),
3333 ifelse(
3434 is.matrix(y_true ),
@@ -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 , ... ),
106- " kernelshap" = use_kernelshap(explainer , new_observation , ... ),
105+ " exact_kernel" = use_exact_shap(explainer , new_observation , output_type , ... ),
106+ " kernelshap" = use_kernelshap(explainer , new_observation , output_type , ... ),
107107 " treeshap" = use_treeshap(explainer , new_observation , ... ),
108108 stop(" Only `exact_kernel`, `kernelshap` and `treeshap` calculation methods are implemented" ))
109109 # quality-check here
@@ -129,7 +129,7 @@ surv_shap <- function(explainer,
129129 return (res )
130130}
131131
132- use_exact_shap <- function (explainer , new_observation , output_type , observation_aggregation_method , ... ) {
132+ use_exact_shap <- function (explainer , new_observation , output_type , ... ) {
133133 shap_values <- sapply(
134134 X = as.character(seq_len(nrow(new_observation ))),
135135 FUN = function (i ) {
0 commit comments