Skip to content

Commit

Permalink
fix check warnings (context in plots)
Browse files Browse the repository at this point in the history
  • Loading branch information
krzyzinskim committed Aug 29, 2023
1 parent eef3583 commit e28fb27
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions R/plot_surv_shap.R
Original file line number Diff line number Diff line change
Expand Up @@ -540,7 +540,7 @@ plot_shap_global_curves <- function(x,
whisker_lower_bound = whisker_lower_bound,
whisker_upper_bound = whisker_upper_bound)

base_plot <- with(list(df_all, df_outliers, df_res),
base_plot <- with(list(df_all, df_res),
{ggplot() +
geom_hline(yintercept = 0, alpha = 0.5, color = colors[1]) +
geom_line(data = df_all, aes(x = x, y = y, group = obs), col = colors[1], alpha = 0.2, linewidth = 0.2) +
Expand All @@ -558,9 +558,12 @@ plot_shap_global_curves <- function(x,
subtitle = subtitle)
})
if (length(outlier_indices) > 0){
base_plot <- base_plot +
geom_line(data = df_outliers, aes(x = x, y = y, group = obs),
col = colors[3], linewidth = 0.5, alpha = 0.1)
base_plot <- with(df_outliers,
{base_plot +
geom_line(data = df_outliers, aes(x = x, y = y, group = obs),
col = colors[3], linewidth = 0.5, alpha = 0.1)
}
)
cat("Observations with outlying SurvSHAP(t) values:\n")
print(x$variable_values[outlier_indices,])
}
Expand Down

0 comments on commit e28fb27

Please sign in to comment.