Icon

02_​Counterfactual_​Explanations_​for_​Keras

Counterfactual Explanations for Keras

This application is a simple example of using Conterfactual Explanations (Python) component to identify the Counterfactual Instances for a Binary classification model trained in Keras outside KNIME eg: Python IDE, Google Colab or Jupyter Notebook.

The Python object reader load the pickled Python object which is used for nomalisation of features, while the Network Reader node reads the keras model trained outside of KNIME. The component (in blue) can be used to select the instances to be used for Counterfactual Explanations.

Data Counterfactual Explanations for Keras SampleAdult Dataset input 0: trained model (Keras or Scikit-Learn)input 1 : preprocessing pickled fileinput 2 : instances to explain---ouput : Counterfactualsenv for data preprcessingpickled objectLoad preprocessLoad keras modeltop 10 rowsenv for tf read and writeTable Reader CounterfactualExplanations (Python) Conda EnvironmentPropagation Python ObjectReader TensorFlow 2Network Reader Row Filter Conda EnvironmentPropagation Data Counterfactual Explanations for Keras SampleAdult Dataset input 0: trained model (Keras or Scikit-Learn)input 1 : preprocessing pickled fileinput 2 : instances to explain---ouput : Counterfactualsenv for data preprcessingpickled objectLoad preprocessLoad keras modeltop 10 rowsenv for tf read and writeTable Reader CounterfactualExplanations (Python) Conda EnvironmentPropagation Python ObjectReader TensorFlow 2Network Reader Row Filter Conda EnvironmentPropagation

Nodes

Extensions

Links