SHAPConfig | R Documentation |
Config class of SHAP.
sagemaker.common::ExplainabilityConfig
-> SHAPConfig
shap_config
Shap Config
new()
Initializes config for SHAP.
SHAPConfig$new( baseline, num_samples, agg_method = c("mean_abs", "median", "mean_sq"), use_logit = FALSE, save_local_shap_values = TRUE, seed = NULL, num_clusters = NULL, text_config = NULL, image_config = NULL )
baseline
(str or list): A list of rows (at least one) or S3 object URI to be used as the baseline dataset in the Kernel SHAP algorithm. The format should be the same as the dataset format. Each row should contain only the feature columns/values and omit the label column/values.
num_samples
(int): Number of samples to be used in the Kernel SHAP algorithm. This number determines the size of the generated synthetic dataset to compute the SHAP values.
agg_method
(str): Aggregation method for global SHAP values. Valid values are "mean_abs" (mean of absolute SHAP values for all instances), "median" (median of SHAP values for all instances) and "mean_sq" (mean of squared SHAP values for all instances).
use_logit
(bool): Indicator of whether the logit function is to be applied to the model predictions. Default is False. If "use_logit" is true then the SHAP values will have log-odds units.
save_local_shap_values
(bool): Indicator of whether to save the local SHAP values in the output location. Default is True.
seed
(int): seed value to get deterministic SHAP values. Default is NULL.
num_clusters
(NULL or int): If a baseline is not provided, Clarify automatically computes a baseline dataset via a clustering algorithm (K-means/K-prototypes). num_clusters is a parameter for this algorithm. num_clusters will be the resulting size of the baseline dataset. If not provided, Clarify job will use a default value.
text_config
(:class:'~sagemaker.clarify.TextConfig'): Config to handle text features. Default is NULL
image_config
(:class:'~sagemaker.clarify.ImageConfig'): Config to handle image features. Default is NULL
get_explainability_config()
Returns config.
SHAPConfig$get_explainability_config()
clone()
The objects of this class are cloneable with this method.
SHAPConfig$clone(deep = FALSE)
deep
Whether to make a deep clone.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.