View source: R/eSHAP_plot_multiclass.R
eSHAP_plot_multiclass | R Documentation |
The SHAP plot for multi-class classification models is a visualization tool that uses the Shapley value to compute feature contributions for single predictions across multiple classes.
eSHAP_plot_multiclass(
task,
trained_model,
splits,
sample.size = 30,
seed = 246,
subset = 1
)
task |
mlr3 task object for multi-class classification |
trained_model |
mlr3 trained learner object |
splits |
mlr3 object defining data splits for train and test sets |
sample.size |
numeric, default to 30. The larger the value, the slower but more accurate the estimate of SHAP values |
seed |
numeric, an integer for reproducibility. Default to 246 |
subset |
numeric, what percentage of the instances to use from 0 to 1 where 1 means all |
A list containing:
combined_plots |
SHAP plot depicting the SHAP values for each class |
shap_data |
A matrix of SHAP values for each class. |
combined_all_classes |
overall SHAP plot depicting the SHAP values for all classes on a single plot |
Other classification:
eSHAP_plot()
Other SHAP:
eSHAP_plot()
library("explainer")
seed <- 246
set.seed(seed)
# Load necessary packages and data...
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.