facet.explanation.base.ExplainerFactory#

class facet.explanation.base.ExplainerFactory(**explainer_kwargs)[source]#

A factory for constructing Explainer objects.

Bases

HasExpressionRepr

Generic types

~T_Model

Metaclasses

ABCMeta

Parameters

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

See pytools.expression.HasExpressionRepr.to_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

abstract make_explainer(model, data)[source]#

Construct a new Explainer to compute shap values.

Parameters
  • model (ExplainerFactory) – fitted learner for which to compute shap values

  • data (Optional[DataFrame]) – background dataset (optional)

Return type

BaseExplainer

Returns

the new explainer instance

abstract to_expression()#

See pytools.expression.HasExpressionRepr.to_expression()

explainer_kwargs: Dict[str, Any]#

Additional keyword arguments to be passed to the explainer constructor.

abstract property explains_raw_output: bool#

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

Return type

bool

abstract property supports_shap_interaction_values: bool#

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

Return type

bool

abstract 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