beg for help in SHAP

Hi, dear all, I have questions and would like expert for help, big thanks!

  1. it seems that Dependence plot node for drawing SHAP is gone. right? (so I use python view instead)

  2. I have download everything for SHAP and get all the python, matpoltlib stuffs for drawing SHAP in python view (see 4th pic). according to AI, after the end loop of SHAP, it should have a colume named “shap_value” for drawing SHAP. But in the table view (2nd pic followed), none of a colume named “shap_value” and thus I add “create colume node” for that (shown followed 3rd pic).

However, after all of this, the python view can’t run (Error: Execution failed: Could not connect to the Python process.) and I change the python preference back from Conda to Bundle, the error shown again there (Execution failed: An exception was raised by the Python Proxy).Seems like none of my installation and python view itself can run…
Begging for help…

my structure (1st pic):


table view from SHAP loop end (2nd pic):

table view from “create colume node” (3rd pic):

4th pic: after update shap, matpolib installation, and after the suggestion from AI, I changed the preference of python in KNIME from bundle to conda:

5th pic: python code for SHAP in python view:

Hi @Xin_12,

To help with SHAP-based interpretation, you can use the SHAP Summarizer component to preprocess your validation set. This component generates a representative sampling table, which you can feed into the bottom input port of the SHAP Loop Start node.

Once the SHAP loop finishes, you can use the Column Rename (Regex) node to rename the SHAP output columns to look like SHAP_{column_name}. Then use the Dependence plot component to visualize the output.

You can check out this example workflow to get started.

Best,
Keerthan

1 Like