LimeTabular#

Link to Algorithm description: LIME

class interpret.blackbox.LimeTabular(model, data, feature_names=None, feature_types=None, **kwargs)#

Exposes LIME tabular explainer from lime package, in interpret API form. If using this please cite the original authors as can be found here: marcotcr/lime

Initializes class.

Parameters:
  • model – model or prediction function of model (predict_proba for classification or predict for regression)

  • data – Data used to initialize LIME with.

  • feature_names – List of feature names.

  • feature_types – List of feature types.

  • **kwargs – Kwargs that will be sent to lime

explain_local(X, y=None, name=None, **kwargs)#

Generates local explanations for provided instances.

Parameters:
  • X – Numpy array for X to explain.

  • y – Numpy vector for y to explain.

  • name – User-defined explanation name.

  • **kwargs – Kwargs that will be sent to lime

Returns:

An explanation object, visualizing feature-value pairs for each instance as horizontal bar charts.