Partial Dependence/ICE Plot

This node requires the use of the Partial Dependence Pre-processing Component to sample the relevant data. This Component can be found on the EXAMPLES server. You can also navigate to the component via EXAMPLES > 00_Components > Model Interpretability > Partial Dependence Pre-processing.

For an example of how to use this node as well as the required Partial Dependence Pre-processing Component, please see this workflow on the KNIME Hub.

This node is able to visualize how the prediction at the output of a model reacts as a single column is changed in a defined range. Such visualization can help you interpret how any model is using a single column locally, that is visualizing the prediction change instance by instance, and globally, visualizing an overall behavior valid for the majority of the instances but not the outliers.

The Individual Conditional Expectation (ICE) visualizes the prediction change locally to a single instance in a simple line plot. You can visualize many ICE plots by having multiple lines in the same charts. Use the markers in the shape of dots to keep track the original column value and the original prediction each instance has. To visualize colors for different groups/category/clusters add a Color Manager node before this node.

The Partial Dependence Plot (PDP) visualizes the global average prediction change over a number of instances in a line plot. By default you can also visualize how widely the single instances predictions vary from the average by means of a colored area around the line plot.

The generated view is highly interactive and custom to your needs. Change the opacity and sizes of the visual elements to your needs from the node dialogue. From the view itself you can toggle between displaying both ICEs and PDP or just one of them.

ICE is useful to assess the exact prediction change an a single instance or on a small group of instances. When visualizing a global behavior of the model for many instances PDP can be useful, even if it could simplify too much the complexity behind such predictions.

The best way to use this node is in a Composite View by interactively filtering and selecting groups of similar instances.

The node supports custom CSS styling. You can simply put CSS rules into a single string and set it as a flow variable 'customCSS' in the node configuration dialog. You will find the list of available classes and their description on our documentation page.

Options

General node options.

Maximum number of rows
Use this option to filter out the input data to a fixed number of rows from the original data table (inport 2). This number corresponds to the maximum number of ICE lines to be displayed.
Choose the row ID column (sampled model table)
Select the column of Row ID's corresponding to the original Row ID's from the training data. This column is chosen from the sampled prediction table at inport 1.
Features sampled by pre-processor
Select one or more features that were sampled BEFORE being scored by the model. You can select all of the features sampled previously, or just one. The node will send you a warning if you didn't select all the sampled features but will execute properly. It will fail during execution if you select a column that was not sampled prior to model application. These features will represent the X-Axis in the view and, if you select more than one, you will be able to change between them from inside the view.
Prediction Columns
Select one or more prediction columns from the sampled model output. Choose columns that represent the model scoring output. These columns must be unique from the feature columns chosen in the other column selection panel. If they are not, you will not be able to execute the node. These predictions will represent the Y-Axis in the view and, if you select more than one, you will be able to change between them from inside the view.
Create image at outport
Select this option to create an SVG image of the chart at outport 1.
Choose the feature for the SVG image
Select the feature column for the X-Axis in the generated SVG image. If this feature column doesn't exist in the selected feature columns, the image will use the first available feature column by default.
Choose the prediction for the SVG image
Select the prediction column for the Y-Axis in the generated SVG image. If this prediction column doesn't exist in the selected prediction columns, the image will use the first available prediction column by default.

PDP/ICE

Partial Dependence and Individual Conditional Expectation Line Options.

Show partial dependence plot
Select this option to display the Partial Dependence Plot of the data on the chart. Selecting this option will enable additional options in the dialog relating to the PDP.
Partial dependence plot color
Using the color chooser, select the color in which to display the PDP line. This color will also apply to the PDP margin area, but the opacity of this area can be configured separately.
PDP line weight
The weight (CSS style "stroke-width") of the PDP line.
Show partial dependence margin
Select this option to display a shaded border of the Partial Dependence Plot of the data on the chart. Selecting this option will enable additional options in the dialog relating to the PDP margin.
PDP margin value
Select the method with which to calculate the distance of the PDP margin from the PDP line. This measure is the instantaneous calculation at a given feature value along the x-axis and is displayed both above and below the PDP line. Both methods use Bessel's Sample Correction (n-1).
PDP margin multiplier
This value determines the scale of the PDP margin with the selected calculation. For example, selecting "Standard Deviation" in the previous option and ".5" in this option will result in a PDP Margin painted .5 x (the instantaneous standard deviation) above and below the PDP line across the feature domain.
PDP margin opacity
Select the opacity of the shaded PDP margin on a scale of 0-1 (0: transparent, 1: opaque).
Show individual conditional expectation lines
Select this option to display a single line for each row of data from the original data table (inport 2) with its values corresponding to the model's output prediction across the feature space.
Individual conditional expectation color
Using the color chooser, select the color in which to display the ICE lines.
ICE line weight
The weight (CSS style "stroke-width") of the ICE lines.
ICE line opacity
Select the opacity of the ICE lines on a scale of 0-1 (0: transparent, 1: opaque).
Show original data points
Select this option to display a single point for each row of data from the original data table (inport 2) with its x-value corresponding to the original data point and it's y-value calculated to fall close to it's sampled prediction. Useful to see the reliability of areas of the sampled predictions which are strongly supported by real data values.
Data point color
Using the color chooser, select the color in which to display the data points.
Data point weight
The weight (css style "r") of the data point SVG elements.
Data point opacity
Select the opacity of the ICE lines on a scale of 0-1 (0: transparent, 1: opaque).

Plot Options

Chart Title (*)
The subtitle of the graph shown above the generated image. If left blank, no subtitle will be shown.
Chart subtitle (*)
The subtitle of the graph shown above the generated image. If left blank, no subtitle will be shown.
Y-Axis % margin
This can be used to set the vertical bounds of the chart by scaling the Y-Axis by a certain percent. The calculation is done using the domain of the Y-Axis as calculated by this node or the existing Data Table Specifications. ex: setting this to 10 with a y-min of 0 and a y-max of 1, the resulting chart will display a range along the y-axis from -0.1-1.1.
Resize to fill screen
If this setting is selected the resulting chart will be displayed in the full width of its native browser component. Selecting this setting disables the width and height options.
Width
If "Resize to fill screen" has not been selected, the image will be rendered at the user specified dimensions. Use this setting to choose the width of the chart in pixels.
Height
If "Resize to fill screen" has not been selected, the image will be rendered at the user specified dimensions. Use this setting to choose the height of the chart in pixels.
Background color
Using the color chooser, select the color in which to display the overall window background.
Data area color
Using the color chooser, select the color in which to display the area within the grid lines explicitly used for displaying the data.
Show grid
Selecting this option chooses to enable the grid lines in the data plane. If selected enables the grid color chooser as the next option.
Grid color
Using the color chooser, select the color for the displayed grid lines, if enabled.
Show warnings in interactive view
Selecting this option will collect warnings accumulated during execution and display them in the interactive view.

Interactivity

Enable controls in view
If checked interactive controls will be enabled in the view. If this option is not selected, no controls will be displayed and the options below will be disabled.
Enable smart zoom controls
Enables vertical scale locking controls.
Enable fullscreen button
Enables the full-screen option when view in conjunction with other views in a wrapped meta-node setting.
Enable title controls
Enables editing the title and subtitle while the interactive view is open if enabled. The title and subtitle must first be set in the Node Dialog fields and then modified in the view, or else these options will not be available.
Enable axis label controls
Enables in-view editing and modification of the axis labels.
Enable PDP controls
Enables controls for the PDP line toggling and weight.
Enable PDP margin controls
Enables controls for the PDP margin, calculation, multiplier and opacity.
Enable ICE controls
Enables controls for toggling ICE lines, their weight and opacity.
Enable data point controls
Enables controls for toggling the display of data points, their weight, and opacity.
Enable static line controls
Enables controls for displaying a static line on the chart, controlling its weight and it's y-value.
Enable Y-Axis margin controls
Enables the option to vertically scale the chart while in the interactive view.
Enable selection controls
Enables "Clear Selection" button, "Mouse Mode Select" button. Only available if selection is enabled in the "Interactive Events" section lower down on this dialog window.
Enable selection/filter event controls
Enable the ability to turn on and off Subscriptions to filters and selection in the view as well as toggle publishing selection events.
Enable grid controls
Enables controls to toggle on and off the grid from the interactive view.
Enable advanced options
Enables an option in the interactive KNIME menu to display visualization options for the partial dependence line, margin, individual conditional expectation lines, and data points (if their respective controls are enabled).
Enable panning in view
Enables horizontal zooming in the view.
Show zoom reset button
Enables a button to reset the scale of the chart when zoom has been altered.
Enable scroll zoom
Enables the use of scrolling to zoom in and out on the chart.
Enable smart-zoom
Enables the locking of the vertical scale to transform and pan through the chart horizontally.
Enable selection in view
Allows the selection of individual rows in the interactive chart. Applying these changes will append a selected row to the original data table (inport 2) and output the new table at outport 2. Enabling selection will also enable the option to have selection controls available in view.
Subscribe to filter events
Selecting this option will listen for other nodes in the same meta-node environment publishing filter events and will render the changes automatically.
Subscribe to selection events
Selecting this option will listen for other nodes in the same meta-node environment publishing selection events and will render the changes automatically.
Publish to selection events
Selecting this option will publish to other nodes in the same meta-node environment changes in the selection state of this node and will render the changes automatically.
Display static line
Selecting this option displays a static horizontal "Threshold" line on the chart and enables additional options regarding that line.
Static color
Using the color chooser, select the color in which to display the static threshold line.
Static line weight
The weight (CSS style "stroke-width") of the static threshold line.
Static line y-value
This option chooses the y-value of the static threshold line on the chart.

Input Ports

Icon
Sampled predictions table created by the "Partial Dependence Pre-processing" Component and the model Predictor node.
Icon
A table with original rows from the data set used to validate the model.

Output Ports

Icon
An SVG image representation of the view if "Generate Image" option was enabled.
Icon
Data table containing the input original rows with a Boolean column appended that represents the selections made in the view.

Views

Interactive View: Partial Dependence/ICE Plot
An interactive Partial Dependence (PDP)/Individual Conditional Expectation (ICE) plot representation of the sampled model output.

Workflows

Links

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.