Icon

01_Compute_LIMEs

Compute Local Model-agnostic Explanations (LIMEs)

This is an example for computing explanation using LIME.
An XGBoost model was picked, but any model and its set of Learner and Predictor nodes can be used.

- Read the dataset about wines
- Partition the data in train and test
- Pick few test set instances rows to explain
- Create local samples for each instance in the input table (LIME Loop Start)
- Score the samples using the predictor node and a trained model
- Compute LIMEs, that is local model-agnostic explanations by training a local GLM using the samples and extracting the weights.
- Visualize them in the Composite View (Right Click > Open View)

Annotations and comments
  • Local Interpretable Model-agnostic Explanation (LIME) This is an example of a computing explanation using LIME. An XGBoost model was picked, but any model and its set of Learner and Predictor nodes can be used. See View -> Description for more information about what the workflow does.
  • only numerical columns can be targets
  • keep only selected prediction column
  • fail if no numerical column is provided
  • features + weight + target
  • remove weight column
  • keep explanation target and statistics as first columns
  • reintroduce filtered out columns
  • add column indicating the current target
  • set importance of columns missing in the local explanation to zero
  • remove all rows (we only need the headers)
  • reset rowid
  • remove intercept if contained
  • filter unimportant features
  • select variables with zero coefficient
  • rename preds cols
  • select explanation maximum size
  • if quality > 5 : good else : bad
  • use sulphates for new class
  • retrieve custom classes
  • for each exp
  • fp
  • tn
  • tp
  • fn
  • remove intercept
  • save it as SVG
  • output a table with SVGs attached
  • remove nulls
  • reset
  • conf matrix type
  • score samples
  • red wine data
  • top input : test set instance rows to be explained bottom input : test set distribution
  • collects explanations
  • top: 90% train set bottom: 10% test set
  • select high sulphates wines to be explained
  • select low sulphates wines to be explained
  • rowid
  • title
  • intro text
  • train the model

Nodes

Extensions

Links