facet.explanation.TreeExplainerFactory#
- class facet.explanation.TreeExplainerFactory(*, model_output=None, feature_perturbation=None, uses_background_dataset=True, **explainer_kwargs)[source]#
A factory constructing
TreeExplainer
instances.- Bases
ExplainerFactory
[Union
[RegressorMixin
,ClassifierMixin
]]- Metaclasses
- Parameters
model_output (
Optional
[str
]) – override the default model output parameter (optional)feature_perturbation (
Optional
[str
]) – override the default (optional) feature_perturbation parameteruses_background_dataset (
bool
) – ifFalse
, don’t pass the background dataset on to the tree explainer even if a background dataset is passed tomake_explainer()
explainer_kwargs (
Any
) – additional keyword arguments to be passed to the explainer
Method summary
Construct a new
Explainer
to compute shap values.Render this object as an expression.
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
if explainers made by this factory will use a background dataset passed to methodmake_explainer()
,False
otherwise.explainer_kwargs
Additional keyword arguments to be passed to the explainer constructor.
Definitions
- make_explainer(model, data=None)[source]#
Construct a new
Explainer
to compute shap values.- Parameters
model (
Union
[RegressorMixin
,ClassifierMixin
]) – fitted learner for which to compute shap values
- Return type
- Returns
the new explainer instance
- to_expression()[source]#
Render this object as an expression.
- Return type
- Returns
the expression representing this object
- property explains_raw_output: bool#
True
if explainers made by this factory explain raw model output,False
otherwise.- Return type
- property supports_shap_interaction_values: bool#
True
if explainers made by this factory allow for calculating SHAP interaction values,False
otherwise.- Return type
- property uses_background_dataset: bool#
True
if explainers made by this factory will use a background dataset passed to methodmake_explainer()
,False
otherwise.- Return type