Skip to main content
. 2023 Jan 3;15(1):314. doi: 10.3390/cancers15010314
Algorithm 1. LIME
Require: Classifier f, Number of samples N
Require: Instance x, and its interpretable version x
Require: Similarity kernel πx, Length of explanation K
Z ← {}
for i ∈ {1, 2, 3,..., N} do
  zi ← Sample around (x)
  ZZ ∪ (zi, f(zi), πx (zi))
end for
wK-Lasso(Z, K)     ▷ with zi as features, f(z) as target
return w