Skip to content

Commit

Permalink
[#150] changes consistent with #150
Browse files Browse the repository at this point in the history
  • Loading branch information
pbiecek committed Jan 15, 2023
1 parent 87bfca9 commit a63c06c
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 8 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: ingredients
Title: Effects and Importances of Model Ingredients
Version: 2.3.0
Version: 2.3.1
Authors@R: c(person("Przemyslaw", "Biecek", email = "[email protected]",
role = c("aut", "cre"),
comment = c(ORCID = "0000-0001-8423-1823")),
Expand Down
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
ingredients 2.3.1
--------------------------------------------------------------
* Changes in default color theme as in [#150](https://github.com/ModelOriented/ingredients/issues/150)

ingredients 2.3.0
--------------------------------------------------------------
* breaking change: `calculate_variable_splits()` now treats `integer` variables as `categorical`. This change is propagated to `ceteris_paribus()`, `partial_dependence()`, `accumulated_dependence()`, `conditional_dependence()`, `aggregate_profiles()`, `DALEX::predict_profile()`, `DALEX::model_profile()`
Expand Down
2 changes: 1 addition & 1 deletion R/plot_aggregated_profiles.R
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ plot.aggregated_profiles_explainer <- function(x, ...,
subtitle = subtitle)


res + DALEX::theme_drwhy() + ylab("average prediction") + xlab("") +
res + DALEX::theme_default_dalex() + ylab("average prediction") + xlab("") +
theme(plot.title = element_text(hjust =0),
plot.subtitle = element_text(vjust = -2, hjust = 0)) +
facet_wrap(~ `_vname_`, scales = facet_scales, ncol = facet_ncol)
Expand Down
8 changes: 4 additions & 4 deletions R/plot_ceteris_paribus.R
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ plot_numerical_ceteris_paribus <- function(all_profiles,

pl +
facet_wrap(~`_vname_`, scales = facet_scales, ncol = facet_ncol) +
DALEX::theme_drwhy()
DALEX::theme_default_dalex()
}


Expand Down Expand Up @@ -297,7 +297,7 @@ plot_categorical_ceteris_paribus <- function(all_profiles,

# prepare plot
pl +
DALEX::theme_drwhy() +
DALEX::theme_default_dalex() +
facet_wrap(~`_vname_`, scales = facet_scales, ncol = facet_ncol) +
theme(axis.text.x = element_text(angle = 90, hjust = 1))
}
Expand Down Expand Up @@ -345,7 +345,7 @@ plot_categorical_ceteris_paribus_profiles <- function(all_profiles,

# prepare plot
pl +
DALEX::theme_drwhy() +
DALEX::theme_default_dalex() +
facet_wrap(~`_vname_`, scales = facet_scales, ncol = facet_ncol) +
theme(axis.text.x = element_text(angle = 90, hjust = 1))
}
Expand Down Expand Up @@ -397,7 +397,7 @@ plot_categorical_ceteris_paribus_bars <- function(all_profiles,
facet_wrap(~`_vname_`, scales = facet_scales, ncol = facet_ncol)+
scale_y_continuous(trans = t_shift) +
coord_flip() +
DALEX::theme_drwhy_vertical() +
DALEX::theme_vertical_default_dalex() +
geom_hline(yintercept=selected_y, size = 0.5, linetype = 2, color = "#371ea3") +
xlab("") + ylab("prediction")
}
2 changes: 1 addition & 1 deletion R/plot_ceteris_paribus_oscillations.R
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ plot.ceteris_paribus_oscillations <- function(x, ..., bar_width = 10) {
ggplot(x, aes(`_vname_`, ymin = 0, ymax = oscillations, color = `_ids_`)) +
geom_linerange(size = bar_width) + coord_flip() +
facet_wrap(~`_ids_`, scales = "free_y") +
ylab("Oscillations") + xlab("") + DALEX::theme_drwhy_vertical() +
ylab("Oscillations") + xlab("") + DALEX::theme_vertical_default_dalex() +
theme(legend.position = "none") +
scale_color_manual(values = DALEX::colors_discrete_drwhy(nlabels))

Expand Down
2 changes: 1 addition & 1 deletion R/plot_feature_importance.R
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ plot.feature_importance_explainer <- function(x, ..., max_vars = NULL, show_boxp
# facets have fixed space, can be resolved with ggforce https://github.com/tidyverse/ggplot2/issues/2933
pl + coord_flip() +
scale_color_manual(values = DALEX::colors_discrete_drwhy(nlabels)) +
facet_wrap(~label, ncol = 1, scales = "free_y") + DALEX::theme_drwhy_vertical() +
facet_wrap(~label, ncol = 1, scales = "free_y") + DALEX::theme_vertical_default_dalex() +
ylab(y_lab) + xlab("") +
labs(title = title, subtitle = subtitle) +
theme(legend.position = "none")
Expand Down

0 comments on commit a63c06c

Please sign in to comment.