plot_top_contributors: Plot top contributions

View source: R/plots.R

plot_top_contributorsR Documentation

Plot top contributions

Description

This function generates a plot of the top contributing features for the top n models.

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 make_xgb_models

models_to_use

A vector of model names to restrict the plot to.

data_to_use

If "training" (default), it will use the full training data. If anything else, it will use the new predictions (must have used add_predictions before).

n_predictors

The maximum number of predictors to show per plot.

n_columns

If multiple models are being plotted, how many columns in the plot grid to use.

color

The color of the bars in the plot.

Examples

plot_top_contributors(shap_table, name, 10)

Mushriq/mixmap documentation built on Jan. 28, 2024, 7:22 p.m.