Codeless Counterfactual Explanation for Deep Learning

I downloaded the example workflow “Train and Explain Keras Network with Counterfactuals.” The environment is only available inside the inside the Python Transform component. Unless I’m missing something, there appears to be no way to install it on my local machine. The conda environment in the propogation node is “C:\Users\mpatt\Anaconda3\envs\env_123.” Bottom line is I can only look at the executed workflow. If I try to rerun it, it fails since the the environment isn’t installed locally. Am I missing something?

Hi @rfeigel -

It’s not just you, I am seeing the same issue. Even though the conda environment variable being passed into the Python Script node looks something like this:


the error message in the node still complains about a reference to C:\Users\mpatt, like it isn’t making use of the flow variable.

@Mpattadkal any additional insight here?

Same problem with the “Counterfactual Explanations for Keras” and “Counterfactual Explanations for scikit-learn (Python)” workflows. Is this an implementation problem or is there a bug in the propogation node?

@rfeigel Thanks for pointing this out, I will look into this and provide you an update this week.
Thank you!

Is KNIME using default keras here? I receive a AttributeError due to '_TensorLike which as far as I have seen happens when keras instead of the implemented tensorflow.keras is used?

Dear @rfeigel

I tried to reproduce this issue, but couldn’t get this error, I have some suggestions

  • If your system already has a conda environment with the name “env_123”, delete it before the execution of this workflow
  • Try executing the conda environment propagation node first in the Python Transform Component and then execute the python script node in it
  • Make sure the Python Integration is configured correctly in your KNIME Analytics Platform using the

Let me know If any of these suggestions work… if not, please attach the screenshot of the error, I will investigate further


Hi, it is a great workflow thanks for that Matt.

However, the python node for Keras in the Counterfactuals component showed several errors. I have been working one by one at the moment successfully until: ‘pandas.core.internals’ is not a package. I will really appreciate a solution. Seems to be a problem between pandas versions, could you generate the pandas file in a more actual version?