Local feature attributions are computed over a feature representation chosen by an upstream data-engineering step, yet they are read as statements about the underlying quantity. We ask how discretizing one continuous feature changes local KernelSHAP and LIME explanations when the classifier is held fixed, and whether the two explainers respond differently. A random forest is trained on UCI Adult and frozen; age is collapsed onto equi-width or quantile bin representatives (k in {3,5,10}) before the model receives it, and the same 120 held-out instances are explained in every condition across multiple seeds. We show analytically and numerically that for KernelSHAP this is exactly equivalent to explaining the unchanged model at the quantized instance against a quantized background, so the comparison is between two effective inputs rather than a pure explainer effect; for LIME no such equivalence holds. Each attribution change is compared with a seed-noise floor from re-running the explainer on the unchanged condition. KernelSHAP's age attribution exceeds its noise floor in all 6 pre-specified conditions (median ratios 2.4-59, all significant after Holm correction); on the raw scale LIME's exceeds its floor in only 2 of 6 and in the rest is no larger than its own run-to-run variation. SHAP's normalized change exceeds LIME's in every condition (rank-biserial 0.81-1.00), while LIME is 2.5-4.6x less consistent across repeats. Predicted classes change for only 0.8-5.8% of instances and held-out ROC-AUC never falls below 0.9097, yet 45-94% of instances show a large SHAP attribution change with no class flip. Feature-importance rankings barely move (median Spearman >= 0.979, top-3 overlap 1.00). The representation change and the change in effective input cannot be separated within a frozen-model design.
Figures & tables
Component
Setting
Dataset
UCI Adult (Becker & Kohavi, 1996)
Split
official UCI train/test partition
Training / test rows
32,561 / 16,281
Positive rate (train / test)
0.241 / 0.236
Features (interpretable / encoded)
12 / 106
Dropped columns
fnlwgt , education-num
Table 1: Experimental configuration. All values are read from the saved run metadata; the one-hot encoding is applied inside the frozen pipeline, so the explainers operate on the 12-column interpretable space while the forest receives 106 columns.
Figure 1: Experimental design. The classifier’s parameters are frozen and the explained instance is never modified; what changes between conditions is the effective input the classifier receives. By Equation ( 3 ) this is exactly equivalent, for KernelSHAP, to explaining the unchanged model at q(x) against a quantized background—so the comparison is between two effective inputs, not a pure explainer effect. For LIME the two framings differ, because its perturbations are drawn in the raw coordinates.
KernelSHAP
LIME
Condition
Δ
ratio
r
pHolm
Δ
ratio
r
pHolm
EW k=3
0.0215
59.43
+1.00
< 0.001
0.0073
3.23
+0.94
< 0.001
EW k=5
0.0033
9.06
+0.93
< 0.001
0.0013
0.59
-0.87
< 0.001
EW k=10
0.0012
3.43
+0.77
< 0.001
0.0001
0.06
-1.00
< 0.001
QT k=3
0.0062
17.02
+1.00
< 0.001
0.0026
1.15
+0.35
0.002
QT k=5
0.0036
9.89
+0.99
< 0.001
0.0022
0.99
-0.04
0.681
Table 2: H1. Median per-instance change Δ=med∣Δϕage∣ in the age attribution under each discretization, in raw attribution units. H1 compares each explainer against itself , so no cross-method normalization is applied here; the normalized scale is used for the SHAP–LIME comparison in Table 4 . Columns give the ratio to the same explainer’s seed-noise floor, the rank-biserial effect size r of a paired Wilcoxon test against that floor, and the Holm-corrected p . Ratios above 1 (bold) indicate the representation effect exceeds the explainer’s own sampling noise; a negative r with a small p means the effect is smaller than that noise, and an r near zero with a large p (LIME, QT k=5 ) means the two cannot be distinguished. Each discretized condition is compared with condition A at the same seed, so the two share the explainer’s random draws; the floor compares different seeds. A ratio below 1 therefore means the representation effect is smaller than run-to-run variation, not that it is absent. The final row is the median across instances of each instance’s median change across seed pairs, which is the quantity the paired test compares against and differs slightly from the pooled median quoted in Section 4.1 . EW = equi-width, QT = quantile.
Figure 2: Per-instance absolute change in the normalized age attribution between the original representation and each discretization, by explainer, on a shared logarithmic axis. Grey boxes and dashed lines mark the seed-noise floor (the same comparison between two repeats of the unchanged condition). Boxes give median and interquartile range; dots are individual instance–repeat observations. Every KernelSHAP condition sits above its floor; on this normalized scale every LIME condition except EW k=3 sits at or below its own. On the raw scale used for the H1 tests (Table 2 ), LIME’s QT k=3 median lies slightly above its floor instead. Values below 10−6 (3 of 9,240 observations) are clipped to the axis floor.
Spearman ρ
top-3 overlap
age rank shift
Condition
SHAP
LIME
SHAP
LIME
SHAP
LIME
EW k=3
0.979
0.986
1.00
1.00
1.50
1.00
EW k=5
0.993
0.993
1.00
1.00
0.00
0.00
EW k=10
1.000
1.000
1.00
1.00
0.00
0.00
QT k=3
0.993
0.993
1.00
1.00
0.00
0.00
QT k=5
0.993
0.993
1.00
1.00
0.00
0.00
Table 3: Ranking stability. Median Spearman correlation between the original and discretized ∣ϕ∣ orderings, median top-3 overlap, and median absolute shift in the age feature’s own rank. The final row is the seed-noise floor. Note that for LIME the ranking agreement under representation change is higher than between two repeats of the unchanged condition; the representation comparison is made at a shared seed, the floor across seeds.
Figure 3: Median Spearman rank correlation between the feature-importance ordering under the original representation and under each discretization, with interquartile range; 1 means the ordering is unchanged. The leftmost pair is the seed-noise floor, the agreement between two repeats of the unchanged condition. The discretized conditions are compared with condition A at a shared seed, so they can show higher agreement than the floor, as LIME does here.
Size of change Δnorm
Within-instance s.d.
Condition
SHAP
LIME
r
pHolm
SHAP
LIME
EW k=3
0.0516
0.0115
+1.00
< 0.001
0.00024
0.00087
EW k=5
0.0092
0.0026
+0.87
< 0.001
0.00009
0.00038
EW k=10
0.0031
0.0005
+0.94
< 0.001
0.00005
0.00021
QT k=3
0.0154
0.0035
+0.99
< 0.001
0.00016
0.00040
QT k=5
0.0101
0.0033
+0.81
< 0.001
0.00010
0.00029
Table 4: H2. SHAP versus LIME on the same instances in each condition. Left: median per-instance age-attribution change on the normalized scale ( ϕj/∑i∣ϕi∣ ), with the rank-biserial effect size and Holm-corrected p of a paired Wilcoxon test between the two explainers on per-instance medians. Right: each explainer’s median within-instance standard deviation across repeats, a measure of its own consistency.
Prediction behaviour
Large ∣Δϕage∣ , no flip
ρ(∣Δϕ∣,∣Δp∣)
Condition
flip
∣Δp∣
AUC
SHAP
LIME
SHAP
LIME
EW k=3
5.8%
0.0052
0.9097
94%
55%
+0.71
+0.16
EW k=5
1.7%
0.0024
0.9125
73%
0%
+0.74
+0.04
EW k=10
0.8%
0.0005
0.9133
52%
0%
+0.73
-0.16
QT k=3
1.7%
0.0034
0.9121
90%
0%
+0.42
-0.06
QT k=5
3.3%
0.0014
0.9125
85%
0%
+0.62
+0.19
Table 5: H3 and prediction agreement. Left: fraction of evaluation instances whose predicted class flips, median ∣Δp∣ , and held-out ROC-AUC under the quantized input. Centre: fraction of instances whose age attribution moves beyond the 95th percentile of the explainer’s own seed-noise distribution (raw units) while the predicted class is unchanged . Right: Spearman correlation between ∣Δϕage∣ and ∣Δp∣ across instances.
Figure 4: Prediction-behaviour diagnostics for the frozen classifier under each discretization. (a) Fraction of evaluation instances whose predicted class changes, and whose predicted probability moves by more than the pre-declared tolerance of 0.05. (b) Distribution of ∣Δp∣ . (c) ROC-AUC on the full held-out test set under the quantized input; the axis is fixed to 0.85–0.95 so that the near-constancy is not visually exaggerated.
Figure 5: Per-instance absolute change in the normalized age attribution against the absolute change in predicted probability, pooled over the six pre-specified conditions; crosses mark instances whose predicted class flipped. The dense vertical band at ∣Δp∣≈0 is the H3 result: explanations that moved substantially while the prediction did not. The quoted ρ is the median across conditions of the within-condition Spearman correlation.
KernelSHAP
LIME weighted local R2
Condition
max ∣εrecon∣
median
IQR
% <0.5
median ( disc= True)
original
1.2e-16
0.545
[0.518, 0.606]
20.3%
0.623
EW k=3
1.1e-16
0.544
[0.517, 0.602]
20.3%
0.620
EW k=5
1.1e-16
0.543
[0.518, 0.604]
20.3%
0.619
EW k=10
2.2e-16
0.544
[0.518, 0.605]
20.3%
0.620
QT k=3
1.1e-16
0.544
[0.518, 0.601]
20.3%
0.624
Table 6: Explanation-quality diagnostics. KernelSHAP’s reconstruction error is at machine precision by construction with ℓ1 regularization disabled. LIME’s weighted local R2 is essentially constant across conditions whose attributions differ, and rises when LIME’s own internal discretization is re-enabled (final column).
Figure 6: Distribution of LIME’s weighted local surrogate R2 across evaluation instances and seeds. Left: the primary configuration, with LIME’s internal discretization disabled so the only discretization present is the one under study. Right: the sensitivity run with the library default re-enabled. A high local R2 means the surrogate fits the model well in the sampled neighbourhood; it does not imply the explanation is stable across seeds or across representations.
Figure 7: Sensitivity analyses. (a) Median normalized attribution change versus bin count, with 95% cluster-bootstrap intervals; dotted horizontal lines are each method’s own seed-noise floor. LIME’s equi-width response falls below its floor from k=5 onward and its quantile response lies below it at every bin count, while KernelSHAP’s stays above at every bin count. (b) Ranking stability versus bin count. LIME sits above its noise floor at every bin count, so discretization perturbs its ordering less than re-running it does; KernelSHAP falls slightly below its own floor at k=3 and k=5 and is above it at k=10 . (c) The headline metric recomputed within each individual repeat; the per-seed lines coincide almost exactly.
SHAP (SHapley Additive exPlanations) feature attribution assigns model predictions to input features using Shapley values from cooperative game theory.
Department of Statistics Virginia Tech · Department of Statistics Virginia Tech Transportation Institute · Department of Computer Science Virginia Tech