facet.explanation.FunctionExplainerFactory#
- class facet.explanation.FunctionExplainerFactory(**explainer_kwargs)[source]#
A factory constructing
Explainer
instances that use Python functions as the underlying model.- Bases
ExplainerFactory
[Union
[RegressorMixin
,ClassifierMixin
,Callable
[[typing.Union[pandas.core.series.Series, pandas.core.frame.DataFrame, numpy.ndarray[typing.Any, numpy.dtype[numpy.float64]]]]
,Union
[Series
,ndarray
[Any
,dtype
[float64
]],float
]]]]- Metaclasses
- Parameters
explainer_kwargs (
Any
) – additional keyword arguments to be passed to the explainer
Method summary
Construct a new
Explainer
to compute shap values.Construct an explainer from a function.
Attribute summary
True
if explainers made by this factory explain raw model output,False
otherwise.True
if explainers made by this factory allow for calculating SHAP interaction values,False
otherwise.True
, since function explainers typically use a background datasetexplainer_kwargs
Additional keyword arguments to be passed to the explainer constructor.
Definitions
- make_explainer(model, data)[source]#
Construct a new
Explainer
to compute shap values.- Parameters
- Return type
- Returns
the new explainer instance
- abstract make_explainer_from_function(model_fn, data)[source]#
Construct an explainer from a function.
- abstract to_expression()#
- abstract property explains_raw_output: bool#
True
if explainers made by this factory explain raw model output,False
otherwise.- Return type