Skip to content

Commit

Permalink
Fix wrong row order in the plot.model_performance
Browse files Browse the repository at this point in the history
  • Loading branch information
maksymiuks committed Jun 9, 2024
1 parent 28a936b commit d49cdc0
Show file tree
Hide file tree
Showing 3 changed files with 8 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: DALEX
Title: moDel Agnostic Language for Exploration and eXplanation
Version: 2.5.1
Version: 2.5.2
Authors@R: c(person("Przemyslaw", "Biecek", email = "[email protected]", role = c("aut", "cre"),
comment = c(ORCID = "0000-0001-8423-1823")),
person("Szymon", "Maksymiuk", 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 @@
DALEX 2.5.2
---------------------------------------------------------------
* Fix wrong row order in the `plot.model_performance` ([#49](https://github.com/ModelOriented/DALEX/issues/49))

DALEX 2.5.1
---------------------------------------------------------------
* adding the support for calculating kernel SHAP values via `predict_parts()` function
Expand Down
3 changes: 3 additions & 0 deletions R/plot_model_performance.R
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ plot.model_performance <- function(x, ..., geom = "ecdf", show_outliers = 0, ptl
}

df$label <- reorder(df$label, df$diff, loss_function)
# Sort df based on the label's levels to make sure downstream functions relying
# on the rows order work appropriately
df <- df[order(df$label), ]
if (ptlabel == "name") {
df$name <- NULL
df$name <- rownames(df)
Expand Down

0 comments on commit d49cdc0

Please sign in to comment.