fatf.utils.transparency.explainers.check_instance_explainer_functionality

fatf.utils.transparency.explainers.check_instance_explainer_functionality(explainer_object: Union[object, type], suppress_warning: bool = False) → bool[source]

Checks whether an explainer object can explain a data point (instance).

New in version 0.0.2.

The explainer object to be checked can either be an uninitialised object reference or an initialised object instance.

This function examines the explainer_object and ensures that it has an explain_instance method with exactly 1 required parameter.

Parameters
explainer_objectobject

A Python object (either an object reference or an instance of an initialised object) that represents an explanation generator.

suppress_warningboolean, optional (default=False)

A boolean parameter that indicates whether the function should suppress the warning message detailing the lacking functionality of the explainer object. Defaults to False.

Returns
is_functionalboolean

A boolean variable that indicates whether the explainer object has all the desired functionality.

Raises
TypeError

The suppress_warning parameter is not a boolean.

Warns
UserWarning

Warns about the required functionality that the explainer object lacks if it has not been disabled with the suppress_warning parameter. Warns if the explainer object does not inherit from the fatf.utils.transparency.explainers.Explainer abstract class.