dianna
dianna copied to clipboard
setting kwrags `silent` for tqdm progress bar in kernelshap
The method kernelshap generates a tqdm progress bar, see here. It is useful to be able to hide the progress bar if explainer should be run several times. The original method has a kwargs silent
to hide tqdm progress bar, see here. However, it is not possible to pass this argument through dianna because of the get_kwargs_applicable_to_function
(in this function args
is only inspected. The args
attribute contains a list of positional arguments and keyword arguments, but it does not include **kwargs-style arguments.).
To address the issue, we can add silent: bool = False
, to __init__
function of KERNELSHAPTabular
and pass it to self.explainer.shap_values
as self.explainer.shap_values(input_tabular, silent=self.silent, **explain_instance_kwargs)