Anchors
LIME assumes a simple model can approximate the local boundary. To avod ths assumption, we can use Anchors.
An anchor finds an IF-THEN rule such as “debt ratio below 0.31 and income above $64,000” that keeps the prediction stable while the remaining features vary.
Precision and coverage
An anchor must satisfy a precision threshold :
Precision asks how often the rule preserves the prediction. Coverage asks how often the rule applies. Strong anchors balance both.
What Precision and Coverage Count
Each dot is a perturbed neighbor of one loan applicant. Switch rules to see which neighbors the rule captures — and of those, how many keep the same prediction.
Coverage
43 of 50 neighbors
= 86%
How often does the rule apply?
Precision
32 of 43 covered
= 74%
Of those covered, how often is the prediction stable?
Precision failures
11 covered neighbors where the prediction changes
Unbalanced data
The perturbation space reflects the training distribution. If your data is unbalanced, sampled perturbations will oversample the majority class, biasing precision and coverage estimates toward it. An anchor that looks reliable may simply be anchoring to the dominant group.
Anchors are constructed through a process called Modified Beam Search. Step through the interactive below to see how it works.
How Beam Search Builds an Anchor
Step through the four stages of anchor construction for a single loan applicant (debt ratio 0.27, income $72k, prediction: approved).
Stage 1 — Candidate Generation
One candidate rule is created per feature, fixing that feature's value for the instance being explained (debt ratio 0.27, income $72k). Each rule constrains which perturbations count as valid.
IF debt < 0.35
IF income > $65k
Round 1: two single-predicate seeds, one per feature.
Instance being explained
debt ratio: 0.27
income: $72k
prediction: approved
Precision threshold τ
0.90
Search progress
Rules are easy to communicate, which makes anchors appealing in operational settings. The tradeoff is that a highly precise rule may explain only a tiny pocket of applicants. A broad rule may include cases where the prediction changes.
Report the rule, precision, coverage, perturbation process, and the population on which those numbers were measured.
Why is a 99% precise anchor with 1% coverage a weak general explanation?