shap.maskers.OutputComposite
- class shap.maskers.OutputComposite(masker, model)
A masker that is a combination of a masker and a model and outputs both masked args and the model’s output.
- __init__(masker, model)
Creates a masker from an underlying masker and and model.
This masker returns the masked input along with the model output for the passed args.
- Parameters:
- masker: object
An object of the shap.maskers.Masker base class (eg. Text/Image masker).
- model: object
An object shap.models.Model base class used to generate output.
- Returns:
- tuple
A tuple consisting of the masked input using the underlying masker appended with the model output for passed args.
Methods
__init__
(masker, model)Creates a masker from an underlying masker and and model.
load
(in_file[, instantiate])Load a OutputComposite masker from a file stream.
save
(out_file)Write a OutputComposite masker to a file stream.
- classmethod load(in_file, instantiate=True)
Load a OutputComposite masker from a file stream.
- save(out_file)
Write a OutputComposite masker to a file stream.