LIME Explainer

Pick a point on the decision space, and watch LIME build a local explanation: perturb, query the black box, fit a weighted linear model, read off which features mattered.

Black-box model

This is the "unknown" classifier LIME tries to explain locally.

LIME parameters


Black-box prediction
LIME local R²
x₁ weight
x₂ weight

How it works

1Pick a point to explain
2Perturb it — create N noisy neighbors
3Query the black box on each neighbor
4Weight neighbors by proximity (kernel)
5Fit a weighted linear model
6Read the coefficients — that's the explanation
ξ(x) = argming∈G L(f, g, πx) + Ω(g) Where πx(z) = exp(−d(x,z)² / σ²) and g is a local linear model.

Decision space — click to pick a point

Background color = black-box prediction (blue vs red). Click anywhere to select the point LIME will explain.

LIME perturbation cloud

Dots = perturbed samples. Color = black-box label. Opacity = kernel weight (closer = brighter). Dashed line = local linear boundary from LIME.

Feature importance (LIME weights)

The linear model's coefficients β₁ (x₁) and β₂ (x₂). Positive = pushes toward class 1 (red), negative = pushes toward class 0 (blue). Longer bar = stronger local influence.