trustyai.explainers.LimeResults

class trustyai.explainers.LimeResults(saliencyResults: SaliencyResults)

Wraps LIME results. This object is returned by the LimeExplainer, and provides a variety of methods to visualize and interact with the explanation.

__init__(saliencyResults: SaliencyResults)

Constructor method. This is called internally, and shouldn’t ever need to be used manually.

Methods

__init__(saliencyResults)

Constructor method.

as_dataframe()

Return the LIME result as a dataframe.

as_html()

Return the LIME results as Pandas Styler objects.

saliency_map()

Return a dictionary of found saliencies.

as_dataframe() DataFrame

Return the LIME result as a dataframe.

Returns:
pandas.DataFrame

Dictionary of DataFrames, keyed by output name, containing the results of the LIME explanation. For each model output, the table will contain the following columns:

  • Feature: The name of the feature

  • Value: The value of the feature for this particular input.

  • Saliency: The importance of this feature to the output.

  • Confidence: The confidence of this explanation as returned by the explainer.

as_html() Styler

Return the LIME results as Pandas Styler objects.

Returns:
Dict[str, pandas.Styler]

Dictionary of stylers keyed by output name. Each styler containing the results of the LIME explanation for that particular output, in the same schema as in as_dataframe(). This will:

  • Color each Saliency based on how their magnitude.

saliency_map() Dict[str, Saliency]

Return a dictionary of found saliencies.

Returns:
Dict[str, Saliency]

A dictionary of Saliency objects, keyed by output name.