Skip to content

Commit

Permalink
candidate fix for #85
Browse files Browse the repository at this point in the history
  • Loading branch information
pbiecek committed Jul 28, 2020
1 parent a341bc3 commit d574460
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: iBreakDown
Title: Model Agnostic Instance Level Variable Attributions
Version: 1.3.0
Version: 1.3.1
Authors@R: c(person("Przemyslaw", "Biecek", email = "przemyslaw.biecek@gmail.com", role = c("aut", "cre"),
comment = c(ORCID = "0000-0001-8423-1823")),
person("Alicja", "Gosiewska", role = "aut",
Expand Down
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
iBreakDown 1.3.1
---------------------------------------------------------------
* fix issue with text coliding with rectangle [#85](https://github.com/ModelOriented/iBreakDown/issues/85)

iBreakDown 1.2.1
---------------------------------------------------------------
* fix the intercept bar color when `baseline` is used (now it's blue)
Expand Down
8 changes: 8 additions & 0 deletions R/plot_break_down.R
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,14 @@ plot.break_down <- function(x, ...,
broken_baseline <- tmp$broken_baseline
x <- tmp$x

# fix for https://github.com/ModelOriented/iBreakDown/issues/85
# check if correction is needed
if (any(x[x$variable == "prediction", "right_side"] < broken_baseline$contribution)) {
# put there max val
x[x$variable == "prediction", "right_side"] <- pmax(x[x$variable == "prediction", "right_side"], broken_baseline$contribution)
}


# base plot
pl <- ggplot(x, aes(x = position + 0.5,
y = pmax(cumulative, prev),
Expand Down

0 comments on commit d574460

Please sign in to comment.