plot_shap_scatter_for_training_samples: Plot SHAP vs Feature Value scatter for training data.

View source: R/plots.R

plot_shap_scatter_for_training_samplesR Documentation

Plot SHAP vs Feature Value scatter for training data.

Description

This function plots the contribution (Shapley values) against the value of a feature.

Usage

plot_shap_scatter_for_training_samples(
  models,
  models_to_use,
  model_data,
  samples_to_use = NULL,
  lineage_to_use = NULL,
  sample_colors = NULL,
  n_features = 6,
  n_columns = 3,
  sample_info = NULL
)

Arguments

models

A list of models generated with make_xgb_models and has appended predictions with add_predictions.

models_to_use

A vector of model names to plot.

model_data

The training dataset used to generate the model.

samples_to_use

Optional to highlight specific samples.

lineage_to_use

Optional to highlight specific samples of certain lineage.

sample_colors

Color vector to use for samples_to_use.

n_features

The number of top contributors to show their individual contribution. All other predictors will have their contribution combined.

n_columns

Number of columns to plot in a grid when plotting more than one sample.

Examples

plot_shap_scatter_for_training_samples(my_models, c("ko_ctnnb1","ko_myod1"), model_dataset, samples_to_use = "my_sample")

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