Description Usage Arguments Value
This function uses user-defined trained models and prediction functions to compute approximate Shapley values for single models. Shapley values can be calculated for a subset of model features which reduces the typically expensive computation of approximate Shapley values in high-dimensional models.
1 2 3 4 5 6 7 8 9 10 11 |
explain |
A data.frame of instances to be explained using Shapley values. |
reference |
Optional. A data.frame with the same format as |
model |
A trained prediction model object used to compute Shapley values. |
predict_function |
A |
target_features |
Optional. A character vector that is a subset of feature names in |
causal |
Optional. A 2-column data.frame of feature names: The 1st column gives causes, the 2nd column gives effects. |
causal_weights |
Optional. A numeric vector of |
sample_size |
A numeric vector of length 1 giving the number of Monte Carlo samples used to compute the stochastic Shapley values for each feature. |
use_future |
Boolean. If |
A data.frame with class shapFlex
of the feature-level Shapley values for all instaces in explain
.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.