Hub
Pricing About
NodeNode / LoopStart

LIME Loop Start

KNIME LabsML Interpretability
Drag & drop
Like

LIME stands for Local Interpretable Model-agnostic Explanations. It tries to explain individual predictions of a black box model by training a local surrogate model that is easier to understand (e.g. a linear model). The intuition behind this approach is that a globally nonlinear model might actually be linear within a small local region of the feature space. In order to learn this kind of local surrogate model, LIME creates a dataset of perturbed rows for a single row of interest, predicts it with the black box model and then learns a local surrogate, which approximates the predictions of the black box model. For more details on the algorithm please see the paper "Why Should I Trust You?" Explaining the Predictions of Any Classifier by Ribeiro et al.

Usage

The top input of this node contains the rows of interest for which the predictions of your model should be explained. Each row in the top table corresponds to one loop iteration, so its size will directly affect the runtime of the loop. The bottom input table is used for sampling, which, in this case, means that column statistics are calculated for all of the feature columns. These statistics are later used to sample new values for the feature columns.

In each iteration of the loop one row of interest is explained. This node produces two tables used for these explanations. The top table contains rows, which are created by sampling according to the statistics of the feature columns in the sampling table. Note that numeric columns (including bit and byte vectors) are assumed to be distributed normally. This table has to be predicted with the Predictor node appropriate to your model at hand. The bottom table is intended for training a local surrogate model (e.g. a linear model). It differs from the top table as follows:

  1. Nominal feature columns are replaced by Double columns where a 1.0 indicates that the sampled value matches that of the row of interest.
  2. Bit and byte vector columns are split up into multiple columns, one for each element.
  3. A weight column is appended, which indicates how similar the sampled row is to the row of interest. A higher value indicates greater similarity.
The loop body should do the following:
  1. Predict the top table with the black box model (predictions must be numerical i.e. in case of a classification model the class probabilities).
  2. Append the prediction column(s) to the bottom table.
  3. Train a local surrogate model that uses the features from the bottom table, weights each row according to the weight column, and approximates the predictions of the black box model. The currently recommended Learner for this task is the H2O Generalized Linear Model Learner (Regression).
  4. Extract and collect the local explanations from the local surrogate model (e.g. the linear coefficients) in one of our Loop End nodes.

Note on vector columns

Since the number of elements in a vector column is not known during configuration, the spec for the second table can't be generated if vectors are among the feature columns. In this case downstream nodes can only be configured once this node has been executed.

Node details

Input ports
  1. Type: Table
    Table containing the rows to explain
    Table containing the rows to be explained.
  2. Type: Table
    Sampling data
    Table containing rows used to perturb rows in the first table.
Output ports
  1. Type: Table
    Predictable table
    This table contains samples that have to be predicted by the Predictor node corresponding to your particular model.
  2. Type: Table
    Local surrogate model table
    This table contains the data used to learn a local surrogate model including a weight column. (The name of the column holding the weights is output as a flow variable with the name weightColumnName ).

Extension

The LIME Loop Start node is part of this extension:

  1. Go to item

Related workflows & nodes

  1. Go to item
  2. Go to item
  3. Go to item

KNIME
Open for Innovation

KNIME AG
Talacker 50
8001 Zurich, Switzerland
  • Software
  • Getting started
  • Documentation
  • Courses + Certification
  • Solutions
  • KNIME Hub
  • KNIME Forum
  • Blog
  • Events
  • Partner
  • Developers
  • KNIME Home
  • Careers
  • Contact us
Download KNIME Analytics Platform Read more about KNIME Business Hub
© 2025 KNIME AG. All rights reserved.
  • Trademarks
  • Imprint
  • Privacy
  • Terms & Conditions
  • Data Processing Agreement
  • Credits