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

ABCMeta

Parameters
  • model_output (Optional[str]) – override the default model output parameter (optional)

  • feature_perturbation (Optional[str]) – override the default (optional) feature_perturbation parameter

  • uses_background_dataset (bool) – if False, don’t pass the background dataset on to the tree explainer even if a background dataset is passed to make_explainer()

  • explainer_kwargs (Any) – additional keyword arguments to be passed to the explainer

Method summary

make_explainer

Construct a new Explainer to compute shap values.

to_expression

Render this object as an expression.

Attribute summary

explains_raw_output

True if explainers made by this factory explain raw model output, False otherwise.

supports_shap_interaction_values

True if explainers made by this factory allow for calculating SHAP interaction values, False otherwise.

uses_background_dataset

True if explainers made by this factory will use a background dataset passed to method make_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
Return type

BaseExplainer

Returns

the new explainer instance

to_expression()[source]#

Render this object as an expression.

Return type

Expression

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

bool

property supports_shap_interaction_values: bool#

True if explainers made by this factory allow for calculating SHAP interaction values, False otherwise.

Return type

bool

property uses_background_dataset: bool#

True if explainers made by this factory will use a background dataset passed to method make_explainer(), False otherwise.

Return type

bool