interpret_community.common.base_explainer module

Defines the base explainer API to create explanations.

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

Bases: GlobalExplainer, LocalExplainer

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

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

Bases: ABC, ChainedIdentity

The base class for explainers that create global explanations.

abstract 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, ChainedIdentity

The base class for explainers that create local explanations.

abstract 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