Skip to content

Commit

Permalink
Use shap_names instead
Browse files Browse the repository at this point in the history
  • Loading branch information
LHBO committed Dec 13, 2024
1 parent ebc00ed commit ebcc1b8
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions R/print_iter.R
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,9 @@ print_iter <- function(internal) {
}

if ("shapley" %in% verbose) {
if (internal$parameters$type == "forecast") {
dt_shapley_est <- internal$iter_list[[iter]]$dt_shapley_est[, -c("explain_idx", "horizon")]
dt_shapley_sd <- internal$iter_list[[iter]]$dt_shapley_sd[, -c("explain_idx", "horizon")]
} else {
dt_shapley_est <- internal$iter_list[[iter]]$dt_shapley_est[, -"explain_id"]
dt_shapley_sd <- internal$iter_list[[iter]]$dt_shapley_sd[, -"explain_id"]
}
shap_names_with_none <- c("none", internal$parameters$shap_names)
dt_shapley_est <- internal$iter_list[[iter]]$dt_shapley_est[, ..shap_names_with_none]
dt_shapley_sd <- internal$iter_list[[iter]]$dt_shapley_sd[, ..shap_names_with_none]

# Printing the current Shapley values
matrix1 <- format(round(dt_shapley_est, 3), nsmall = 2, justify = "right")
Expand Down

0 comments on commit ebcc1b8

Please sign in to comment.