Jump to content

Connect Leeroopedia MCP: Equip your AI agents to search best practices, build plans, verify code, diagnose failures, and look up hyperparameter defaults.

Implementation:Interpretml Interpret LimeTabular

From Leeroopedia


Metadata

Field Value
Sources Repo: InterpretML, Doc: LIME
Domains Interpretability, Feature_Attribution
Updated 2026-02-07
Type Wrapper Doc (wraps lime.lime_tabular.LimeTabularExplainer)

Overview

Wrapper tool for computing LIME explanations for blackbox models on tabular data, integrating the lime library into the InterpretML API.

Description

The LimeTabular class wraps lime.lime_tabular.LimeTabularExplainer. It initializes with a model and reference data, then generates per-sample explanations showing feature importance via locally fitted linear models.

Usage

Use this when you need LIME-based local explanations through the InterpretML visualization pipeline.

Code Reference

Field Value
Source interpretml/interpret
File python/interpret-core/interpret/blackbox/_lime.py
Lines 16-172
Import from interpret.blackbox import LimeTabular
External lime.lime_tabular.LimeTabularExplainer (lazy import)

Signature:

class LimeTabular(ExplainerMixin):
    available_explanations = ["local"]
    explainer_type = "blackbox"

    def __init__(self, model, data, feature_names=None, feature_types=None, **kwargs):
    def explain_local(self, X, y=None, name=None, **kwargs):

I/O Contract

Init inputs:

Parameter Type Required Notes
model predict function Yes
data reference data Yes
feature_names list No
feature_types list No

explain_local inputs:

Parameter Type Required Notes
X ndarray Yes
y ndarray No
name str No

explain_local output: FeatureValueExplanation

Usage Examples

from interpret.blackbox import LimeTabular
from interpret import show

lime_exp = LimeTabular(rf.predict_proba, X_train)
local_explanation = lime_exp.explain_local(X_test[:5], y_test[:5], name="LIME")
show(local_explanation, key=0)

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment