From 0d2acb1caf257607972efbc6eee106a58c647074 Mon Sep 17 00:00:00 2001 From: Pedro Larroy Date: Thu, 8 Jul 2021 16:58:36 -0700 Subject: [PATCH 1/3] documentation: Mark baseline as optional in KernelSHAP. --- src/sagemaker/clarify.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/sagemaker/clarify.py b/src/sagemaker/clarify.py index 99dbc018b0..59a64e95d2 100644 --- a/src/sagemaker/clarify.py +++ b/src/sagemaker/clarify.py @@ -305,10 +305,11 @@ def __init__( """Initializes config for SHAP. Args: - baseline (str or list): A list of rows (at least one) or S3 object URI to be used as + baseline (None or str or list): None or S3 object Uri or A list of rows (at least one) 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. + and omit the label column/values. If None a baseline will be calculated automatically by using K-means + or K-prototypes in the input dataset. 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. From c8a2a27f61442376b3e0b688742620102fc59de9 Mon Sep 17 00:00:00 2001 From: Ahsan Khan Date: Tue, 27 Jul 2021 16:29:52 -0700 Subject: [PATCH 2/3] fix pylint --- src/sagemaker/clarify.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/sagemaker/clarify.py b/src/sagemaker/clarify.py index 59a64e95d2..cdb54d6b42 100644 --- a/src/sagemaker/clarify.py +++ b/src/sagemaker/clarify.py @@ -305,11 +305,11 @@ def __init__( """Initializes config for SHAP. Args: - baseline (None or str or list): None or S3 object Uri or A list of rows (at least one) 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. If None a baseline will be calculated automatically by using K-means - or K-prototypes in the input dataset. + baseline (None or str or list): None or S3 object Uri or A list of rows (at least one) + to be used asthe 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. If None a baseline will be + calculated automatically by using K-means or K-prototypes in the input dataset. 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. From 117fa5d1d24e4ea66491b74dbd427e214b11c25c Mon Sep 17 00:00:00 2001 From: Ahsan Khan Date: Wed, 28 Jul 2021 11:55:24 -0700 Subject: [PATCH 3/3] fix sphinx --- src/sagemaker/clarify.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/sagemaker/clarify.py b/src/sagemaker/clarify.py index cdb54d6b42..40a62a985d 100644 --- a/src/sagemaker/clarify.py +++ b/src/sagemaker/clarify.py @@ -306,10 +306,10 @@ def __init__( Args: baseline (None or str or list): None or S3 object Uri or A list of rows (at least one) - to be used asthe 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. If None a baseline will be - calculated automatically by using K-means or K-prototypes in the input dataset. + to be used asthe 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. If None a baseline will be + calculated automatically by using K-means or K-prototypes in the input dataset. 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.