shap.maskers.OutputComposite

class shap.maskers.OutputComposite(masker, model)

一个由掩码器和模型组合而成的掩码器,同时输出掩码参数和模型的输出。

__init__(masker, model)

从底层掩码器和模型创建一个掩码器。

此掩码器返回掩码输入以及传递参数的模型输出。

参数:
掩码器:对象

shap.maskers.Masker 基类的对象(例如,文本/图像掩码器)。

模型:对象

用于生成输出的 shap.models.Model 基类的对象。

返回:
tuple

一个元组,由使用底层掩码器掩码的输入以及传递参数的模型输出组成。

方法

__init__(masker, model)

从底层掩码器和模型创建一个掩码器。

load(in_file[, instantiate])

从文件流加载 OutputComposite 掩码器。

save(out_file)

将 OutputComposite 掩码器写入文件流。

属性

shape

clustering

classmethod load(in_file, instantiate=True)

从文件流加载 OutputComposite 掩码器。

save(out_file)

将 OutputComposite 掩码器写入文件流。