Lion Cipher Lab

Explain a single model prediction with LIME

Why it matters

Models are increasingly shaping decisions that matter -- flagging an alert, scoring a transaction, ranking a resume -- and a beginner's most valuable habit is refusing to treat those decisions as unquestionable. Explainability is the concrete skill behind that habit: being able to ask 'which inputs pushed this particular prediction, and by how much.' LIME is one of the two best-known open-source ways to answer that for a single prediction, and it is worth learning precisely because it works differently from SHAP -- it treats the model as a sealed box and probes it from the outside. Learning…

What you'll learn

Steps in this lab

  1. Why a model needs to explain itself
  2. How LIME works, in plain terms
  3. Install LIME and scikit-learn
  4. Train a tiny model of your own
  5. Point LIME at the model
  6. Explain one prediction and read it
  7. The limits: local, unstable, approximate, and gameable
  8. What you carry out of this lab

Open the full interactive lab →