A machine learning engineer is deploying a model to production that predicts customer sentiment from text reviews. The business stakeholders require not only accurate predictions but also a robust explanation for why a particular review was classified as positive or negative, highlighting the key words or phrases. Which explainability technique is best suited for providing local, interpretable explanations for individual predictions?
- ALIME (Local Interpretable Model-agnostic Explanations)
- BPartial Dependence Plots (PDPs)
- CPermutation Feature Importance
- DSHAP (SHapley Additive exPlanations)
Show answer & explanationAnswer & explanation
Correct answer: A. LIME (Local Interpretable Model-agnostic Explanations)
The requirement is for local, interpretable explanations for individual predictions, specifically highlighting key words or phrases in text data. LIME is designed to explain individual predictions by approximating the complex model locally with an interpretable model (e.g., linear model), often by perturbing the input (e.g., masking words) and observing changes in prediction. This allows it to identify the most influential features (words/phrases) for a specific prediction.
Why the other options are wrong
- B. Partial Dependence Plots show the marginal effect of one or two features on the predicted outcome, providing a global understanding, not local explanations for individual instances.
- C. Permutation Feature Importance provides global feature importance for the entire model, not local explanations for individual predictions.
- D. SHAP provides unified, consistent local explanations, but LIME is often more directly intuitive for text, showing which words contribute positively or negatively to a specific prediction by perturbing text.
LIME (Local Interpretable Model-agnostic Explanations)
LIME is an explainability technique that explains the predictions of any machine learning model by approximating it locally with an interpretable model.
- Provides local explanations for individual predictions.
- Model-agnostic, can be used with any black-box model.
- For text, it highlights words/phrases contributing to a specific classification.
Memory trick: To 'LIME' a 'local' explanation, you 'shine a light' on what makes a single prediction 'bright'.