Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: shapviz
Title: SHAP Visualizations
Version: 0.10.2
Version: 0.10.3
Authors@R: c(
person("Michael", "Mayer", , "mayermichael79@gmail.com", role = c("aut", "cre")),
person("Adrian", "Stando", , "adrian.j.stando@gmail.com", role = "ctb")
Expand Down
6 changes: 6 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# shapviz 0.10.3

### Bug fixes

- Solves compatibility warning with ggplot 4.0.

# shapviz 0.10.2

### Bug fixes
Expand Down
2 changes: 1 addition & 1 deletion R/sv_force.R
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ sv_force.shapviz <- function(
axis.ticks.y = ggplot2::element_blank(),
axis.text.y = ggplot2::element_blank()
) +
ggplot2::labs(y = ggplot2::element_blank(), x = "Prediction")
ggplot2::labs(y = NULL, x = "Prediction")

if (show_annotation) {
p <- p +
Expand Down
10 changes: 4 additions & 6 deletions R/sv_importance.R
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ sv_importance.shapviz <- function(
if (is_bar) {
p <- ggplot2::ggplot(imp_df, ggplot2::aes(x = value, y = feature)) +
ggplot2::geom_bar(fill = fill, width = bar_width, stat = "identity", ...) +
ggplot2::labs(x = "mean(|SHAP value|)", y = ggplot2::element_blank())
ggplot2::labs(x = "mean(|SHAP value|)", y = NULL)
} else {
# Prepare data.frame for beeswarm plot
S <- get_shap_values(object)
Expand Down Expand Up @@ -136,9 +136,7 @@ sv_importance.shapviz <- function(
bar = !is.null(color_bar_title),
ncol = length(unique(df$color)) # Special case of constant feature values
) +
ggplot2::labs(
x = "SHAP value", y = ggplot2::element_blank(), color = color_bar_title
) +
ggplot2::labs(x = "SHAP value", y = NULL, color = color_bar_title) +
ggplot2::theme(legend.box.spacing = grid::unit(0, "pt"))
}
if (show_numbers) {
Expand Down Expand Up @@ -212,7 +210,7 @@ sv_importance.mshapviz <- function(
position = bar_type,
...
) +
ggplot2::labs(fill = ggplot2::element_blank()) +
ggplot2::labs(fill = NULL) +
do.call(ggplot2::scale_fill_viridis_d, viridis_args) +
ggplot2::guides(fill = ggplot2::guide_legend(reverse = TRUE))
} else { # facets
Expand All @@ -222,7 +220,7 @@ sv_importance.mshapviz <- function(
}
p <- p +
ggplot2::xlab("mean(|SHAP value|)") +
ggplot2::ylab(ggplot2::element_blank())
ggplot2::ylab(NULL)
return(p)
}

Expand Down
6 changes: 2 additions & 4 deletions R/sv_interaction.R
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ sv_interaction.shapviz <- function(

p <- ggplot2::ggplot(imp_df, ggplot2::aes(x = value, y = feature)) +
ggplot2::geom_bar(fill = fill, width = bar_width, stat = "identity", ...) +
ggplot2::labs(x = "mean(|SHAP interaction value|)", y = ggplot2::element_blank())
ggplot2::labs(x = "mean(|SHAP interaction value|)", y = NULL)

return(p)
}
Expand Down Expand Up @@ -134,9 +134,7 @@ sv_interaction.shapviz <- function(
...
) +
ggplot2::facet_grid(Variable1 ~ Variable2, switch = "y") +
ggplot2::labs(
x = "SHAP value", y = ggplot2::element_blank(), color = color_bar_title
) +
ggplot2::labs(x = "SHAP value", y = NULL, color = color_bar_title) +
.get_color_scale(
viridis_args = viridis_args,
bar = !is.null(color_bar_title),
Expand Down
2 changes: 1 addition & 1 deletion R/sv_waterfall.R
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ sv_waterfall.shapviz <- function(
axis.line.x = ggplot2::element_line(),
axis.ticks.y = ggplot2::element_blank()
) +
ggplot2::labs(y = ggplot2::element_blank(), x = "Prediction")
ggplot2::labs(y = NULL, x = "Prediction")

if (show_connection) {
p <- p +
Expand Down
2 changes: 1 addition & 1 deletion packaging.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ library(usethis)
use_description(
fields = list(
Title = "SHAP Visualizations",
Version = "0.10.2",
Version = "0.10.3",
Description = "Visualizations for SHAP (SHapley Additive exPlanations),
such as waterfall plots, force plots, various types of importance plots,
dependence plots, and interaction plots.
Expand Down