Skip to contents

Plot the top contributing features for one or more POWERUP models. Models without feature contributions for the requested data source are omitted.

Usage

plot_top_contributors(
  models,
  models_to_use = NULL,
  data_to_use = "training",
  n_predictors = 10,
  n_columns = 5,
  color = "#52565e",
  labels_data = NULL,
  sec_label = NULL
)

Arguments

models

A list of model objects generated by fit_powerup_models().

models_to_use

Optional character vector of model names to plot. NULL uses all models.

data_to_use

Data source to plot: "training" or "new_data".

n_predictors

Maximum number of top contributing features to show per model, including ties at the cutoff.

n_columns

Number of columns in the resulting plot grid.

color

Bar color.

labels_data

Optional data frame containing old_label and new_label columns for model-label replacement.

sec_label

If non-NULL, use labels_data$second_label as the plot subtitle for mapped models.

Value

A ggplot object containing the assembled grid of feature-contribution plots.

Examples

if (FALSE) { # \dontrun{
plot_top_contributors(my_models, models_to_use = "ko_ctnnb1", n_predictors = 10)
} # }