0 ×

SHAP Loop End

KNIME Machine Learning Interpretability Extension version 4.3.0.v202011191524 by KNIME AG, Zurich, Switzerland

Calculates the SHAP values by evaluating the predictions your model made in the loop body. For each explained row of interest (rows in the first input table of the SHAP Loop Start node, we will refer to these as ROI), the output table of this node contains d rows where d is the number of predictions your model produces (e.g. one for each class probability in a classification task). The rows consist of four special columns followed by a column for each of your features that hold the SHAP value of that feature for the current prediction column. The special columns are:

  • RowId: Holds the RowId of the explained ROI.
  • Target: The name of the prediction column that is explained.
  • Actual Prediction: The actual prediction for the unaltered ROI.
  • Deviation from mean prediction: How much the prediction for this ROI differs from the mean prediction on the sampling table (second input table of the SHAP Loop Start).
The SHAP value for a single feature indicates how much this feature contributed to the deviation from the mean prediction. Provided the explanation set size is large enough, the values for all features should add up to the deviation from the mean prediction.

Options

Automatically detect prediction columns
With this option SHAP will use all numeric columns that were added in the loop body as prediction columns.
Manually select prediction column
Allows you to manually select the prediction columns among the input columns of this node.
Regularize explanations
SHAP calculates the contributions of all features to the prediction but especially in cases where there are many features, it is oftentimes important to get concise explanations that only consider the most important features (i.e. those features that have the most influence on the prediction). If this box is checked, SHAP will use a linear model with LASSO regularization to find the features that have the strongest influence on the predictions.
Maximum number of active features
The number of features you want to have participating in your explanations. The remaining features will receive SHAP values of 0. The feature selection is performed via the LASSO.
Order column
Allows to select the order column if its name has been altered in the loop body. By default the order column produced by the loop start is selected.
Use element names for collection features
Collection and vector columns can store names for the individual elements they contain. By checking this box, these names will be used in the explanations produced by this node. Otherwise the columns corresponding to collection features will be named according to their collection followed by an index. Note that we also use the latter naming strategy if the number of names stored in a collection column is different from the number of elements in the collection.

Input Ports

Icon
Table containing predictions for the perturbed rows produced by the Shapley Values Loop Start node

Output Ports

Icon
Table containing the Shapley Values for each feature-prediction combination

Best Friends (Incoming)

Best Friends (Outgoing)

Workflows

Installation

To use this node in KNIME, install KNIME Machine Learning Interpretability Extension from the following update site:

KNIME 4.3

A zipped version of the software site can be downloaded here.

You don't know what to do with this link? Read our NodePit Product and Node Installation Guide that explains you in detail how to install nodes to your KNIME Analytics Platform.

Wait a sec! You want to explore and install nodes even faster? We highly recommend our NodePit for KNIME extension for your KNIME Analytics Platform. Browse NodePit from within KNIME, install nodes with just one click and share your workflows with NodePit Space.

Developers

You want to see the source code for this node? Click the following button and we’ll use our super-powers to find it for you.