Skip to content

Commit 58ee40d

Browse files
Updated waring to emphasize sampling with replacement.
1 parent db1c0e6 commit 58ee40d

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

alibi/explainers/shap_wrappers.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -1171,11 +1171,12 @@ def fit(self, # type: ignore[override]
11711171
# leave the logic above untouched. This approach has at least two benefits:
11721172
# i) minimal refactoring
11731173
# ii) return the correct result if a newer version of shap which fixes the issue is used before we
1174-
# update our wrapper in alibi (i.e. just ignore the warning)
1174+
# update our dependencies in alibi (i.e. just ignore the warning)
11751175
if n_samples > TREE_SHAP_BACKGROUND_SUPPORTED_SIZE:
1176-
logger.warning('The upstream implementation of interventional TreeShap supports only up to '
1176+
logger.warning(f'The upstream implementation of interventional TreeShap supports only up to '
11771177
f'{TREE_SHAP_BACKGROUND_SUPPORTED_SIZE} samples in the background dataset. '
1178-
'A larger background dataset size will result in erroneous Shap values.')
1178+
f'A larger background dataset will be sampled with replacement to '
1179+
f'{TREE_SHAP_BACKGROUND_SUPPORTED_SIZE} instances.')
11791180

11801181
perturbation = 'interventional' if background_data is not None else 'tree_path_dependent'
11811182
self.background_data = background_data

0 commit comments

Comments
 (0)