Icon

01_​Train_​and_​Explain_​Keras_​Network_​with_​Counterfactuals

Train and Explain Keras Network with Counterfactuals

This application is a simple example of using Conterfactual Explanations (Python) Component to identify the counterfactual instances for a Binary classification model trained in KNIME with Keras.

The Component (in yellow) uses KNIME Python Integration for normalisation of features and outputs the features along with the pickled file containing the preprocessing object. The Component (in blue) can be used to select the instances to be used for Counterfactual Explainations.

Counterfactuals Explainations for Keras model trained in KNIME input 0: trained model (Keras or Scikit-Learn)input 1 : preprocessing pickled fileinput 2 : instances to explain---ouput : CounterfactualsSampleAdult DatasetInputDense 64softmaxreshape for dynamicDL TrainingEpochs : 10Batch size : 100hidden layer : 64 NeuronsImputing Missing ValueManual feature selection top 5 rowsVisualize singleinstanceInputport 0: raw data Outputport 0: Transformed dataport 1 : pickled objectCounterfactualExplanations (Python) Table Reader(deprecated) Keras Input Layer Keras Dense Layer Keras Dense Layer Keras Reshape Layer Keras NetworkLearner Data Preprocessing Row Filter Bar Chart Instance Selection Python Transform Counterfactuals Explainations for Keras model trained in KNIME input 0: trained model (Keras or Scikit-Learn)input 1 : preprocessing pickled fileinput 2 : instances to explain---ouput : CounterfactualsSampleAdult DatasetInputDense 64softmaxreshape for dynamicDL TrainingEpochs : 10Batch size : 100hidden layer : 64 NeuronsImputing Missing ValueManual feature selection top 5 rowsVisualize singleinstanceInputport 0: raw data Outputport 0: Transformed dataport 1 : pickled objectCounterfactualExplanations (Python) Table Reader(deprecated) Keras Input Layer Keras Dense Layer Keras Dense Layer Keras Reshape Layer Keras NetworkLearner Data Preprocessing Row Filter Bar Chart Instance Selection Python Transform

Nodes

Extensions

Links