interpret_community.common.base_explainer module

Defines the base explainer API to create explanations.

class interpret_community.common.base_explainer.BaseExplainer(*args, **kwargs)

Bases: interpret_community.common.base_explainer.GlobalExplainer, interpret_community.common.base_explainer.LocalExplainer

The base class for explainers that create global and local explanations.

class interpret_community.common.base_explainer.GlobalExplainer(*args, **kwargs)

Bases: abc.ABC, interpret_community.common.chained_identity.ChainedIdentity

The base class for explainers that create global explanations.

explain_global(*args, **kwargs)

Abstract method to globally explain the given model.

Note evaluation examples can be optional on derived classes since some explainers don’t support it, for example MimicExplainer.

Returns:A model explanation object containing the global explanation.
Return type:GlobalExplanation
class interpret_community.common.base_explainer.LocalExplainer(*args, **kwargs)

Bases: abc.ABC, interpret_community.common.chained_identity.ChainedIdentity

The base class for explainers that create local explanations.

explain_local(evaluation_examples, **kwargs)

Abstract method to explain local instances.

Parameters:evaluation_examples (object) – The evaluation examples.
Returns:A model explanation object containing the local explanation.
Return type:LocalExplanation