shap.utils.MaskedModel

class shap.utils.MaskedModel(model, masker, link, *args)

This is a utility class that combines a model, a masker object, and a current input.

The combination of a model, a masker object, and a current input produces a binary set function that can be called to mask out any set of inputs. This class attempts to be smart about only evaluating the model for background samples when the inputs changed (note this requires the masker object to have a .invariants method).

__init__(model, masker, link, *args)

Initialize self. See help(type(self)) for accurate signature.

Methods

__init__(model, masker, link, *args)

Initialize self.

main_effects([inds])

Compute the main effects for this model.

varying_inputs()

Attributes

delta_mask_noop_value

mask_shapes

main_effects(inds=None)

Compute the main effects for this model.