C3w5 - LIME - "model, which is weighted by the distance from the sampled instances to the result that we’re interpreting.”

From 0min51sec:

“With this new dataset LIME then trains an interpretable model, which is weighted by the distance from the sampled instances to the result that we’re interpreting.”

I’m not sure what is meant by “model, which is weighted”. How can a model be weighted ? In what sense ? I understand that neurons/units in a neural networks have weights that are the coefficients in a function that maps inputs to the labels, however I’m not sure what is meant here by a model being weighted.

I’m not sure what is meant by “sampled instances”. Does ‘sampled’ mean permuted/modified as in the feature values that LIME is modifying ?? Does ‘instances’ refer to training data examples or something else ??

Also, I’m not sure whether the “result we’re interpreting” refers to is the new result using the newly-trained model that has been trained with new fake data generated by LIME or to the original result of the original model which we are actually trying to learn about.

Do we need to learn how a new fake dataset makes its predictions and then somehow, that will tell us how our real dataset makes its predictions, which surely could be different from the fake predictions ?

Also, I’m still not 100% clear on global vs local. Does it refer to ‘all the features’ vs ‘specific individual features’ or to the ‘all examples in a training dataset’ vs ‘subsets/batches of examples’ or something else ?

In lime, there are 2 models:

  1. Original model i.e. the model you created
  2. Surrogate model i.e. the model created by LIME for explaining a particular data point.

These are the steps:

  1. Pick an instance on which you want explanation.
  2. Generate new points close to this instance by introducing small changes to this single instance based on distribution of other features.
  3. Make prediction on new points are labelled using the original model uaing lasso regression.
  4. Now, we want this surrogate model to arrive at the same predictions as the original model on this smaller dataset consisting of the single instance and all generated points. So, train it.
  5. When calculating loss while fitting this surrogate model, distance between each point to the single instance is used to weight the loss. This gives a more robust measure of loss than weighing all losses equally.
  6. Once the model is done fitting data, we now have fewer coefficients than original model due to sparsity. Use these coefficients to explain the selected single instance.

Local explainability refers to explaining how a model arrived at the prediction of a single instance.

Global explainability is not tied to any single row of data but shows the general trend of the model in terms of model weights. Think of it as explaining model coefficients based on the entire dataset.