While implementing shap.PermutationExplainer, I used a simple numpy.array as a masker (as is suggested in the documentation). However, when I tried to implement the shap_values method for this explainer I got the error:
TypeError: ‘numpy.ndarray’ object is not callable
… which is justified because internally, while computing the shap values, a masked model is set up which has the following commands, which assumes self.masker to be a function only (I think) where as my self.masker is an numpy.array
delta_mask = mask ^ last_mask
if do_delta_masking and delta_mask.sum() == 1:
delta_ind = np.nonzero(delta_mask)[0][0]
masked_inputs = self.masker(delta_ind, *self.args).copy()
else:
masked_inputs = self.masker(mask, *self.args)
user25508080 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.