Skip to content

Commit 9fc42bd

Browse files
committed
Fix issue with sv_interaction(kind = "bar")
1 parent 7c2ad72 commit 9fc42bd

File tree

5 files changed

+14
-7
lines changed

5 files changed

+14
-7
lines changed

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package: shapviz
22
Title: SHAP Visualizations
3-
Version: 0.10.1
3+
Version: 0.10.2
44
Authors@R: c(
55
person("Michael", "Mayer", , "[email protected]", role = c("aut", "cre")),
66
person("Adrian", "Stando", , "[email protected]", role = "ctb")

NEWS.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
# shapviz 0.10.2
2+
3+
### Bug fixes
4+
5+
- `sv_interaction(..., type = "bar")`: Bars of feature pairs appeared twice, see [#178]([https://github.com/ModelOriented/shapviz/issues/178]).
6+
17
# shapviz 0.10.1
28

39
### Maintenance

R/sv_interaction.R

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,11 +81,15 @@ sv_interaction.shapviz <- function(
8181
}
8282

8383
if (kind == "bar") {
84+
# Drop symmetric part for plotting
85+
M[row(M) > col(M)] <- NA
86+
8487
# Turn to long format and make feature pair names
8588
imp_df <- transform(
8689
as.data.frame.table(M, responseName = "value"),
8790
feature = ifelse(Var1 == Var2, as.character(Var1), paste(Var1, Var2, sep = ":"))
8891
)
92+
imp_df <- imp_df[!is.na(imp_df$value), ]
8993
if (sort_features) {
9094
imp_df <- imp_df[order(imp_df$value, decreasing = TRUE), ]
9195
imp_df <- transform(imp_df, feature = factor(feature, levels = rev(feature)))

cran-comments.md

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
1-
# shapviz 0.10.1
1+
# shapviz 0.10.2
22

33
Hello CRAN team
44

5-
Today, I have pushed 0.10.0 to CRAN. Unfortunately, I have not correctly adapted the minimal version of its
6-
ggplot2 dependency in the DESCRIPTION, which is very important. This small update fixes this.
7-
8-
Thank you for your understanding (and flexibility!).
5+
This small update fixes a mistake in a new visualization, where feature pairs appeared twice (a:b and b:a).
96

107
### Local checks
118

packaging.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ library(usethis)
1515
use_description(
1616
fields = list(
1717
Title = "SHAP Visualizations",
18-
Version = "0.10.1",
18+
Version = "0.10.2",
1919
Description = "Visualizations for SHAP (SHapley Additive exPlanations),
2020
such as waterfall plots, force plots, various types of importance plots,
2121
dependence plots, and interaction plots.

0 commit comments

Comments
 (0)