PRINT exp.scorethe surrogate's R² · measured as low as 0.006 while still rendering a confident chart
< 0.3 → discard itthe neighbourhood isn't linear · the coefficients are noise
the 4 stepsperturb → predict → weight by proximity → fit a sparse linear model
universal shapeExplainer(train) → explain_instance(row, predict_fn) → as_list()
clf → predict_probaclf.predict raises NotImplementedError · regression → plain predict
LIME is NOT additiveweights don't sum to the prediction · that's SHAP's guarantee, not LIME's
weights are BINS"4 < rooms <= 5" → +0.57 means "for being in that bracket", not per room
num_samples is the knobspread 0.145 at 100 → 0.019 at 5000 · instability is self-inflicted
always set random_statedefault is None → unreproducible explanations
text: no training_datapass raw strings + a pipeline's predict_proba (vectorizer inside)
bow=True ignores orderset bow=False for transformers and order-sensitive models
declare categorical_featuresor one-hot columns get perturbed to 0.37
sample_around_instancedefaults to False — samples the global distribution, not your neighbourhood
images: segmentation IS the feature spacebad superpixels → meaningless explanation
SubmodularPicka few covering rows > hundreds of random ones · the defensible way to present LIME
text → LIME · tabular → SHAPmeasured: R² 0.9999 on text, median 0.56 on tabular