Icon

DL 100 Keras Basic Classification

<p>A simple deep learning network for binary classification using the KNIME Keras integration (with a Python environment propagation)<br>Please note this example should demonstrate how to set up the deep learning environment with Keras and provide a working simple example.<br><br>Adapted from: https://kni.me/w/Cm0lqIKkvThyHAD-<br>"This workflow trains a fully connected, feedforward network using the adult dataset."<br><br>please download the complete DeepLearning (Keras, Tensorflow, H2O.ai) Workflow group:<br>https://hub.knime.com/mlauber71/spaces/Public/latest/kn_example_deeplearning_keras_tensorflow_classification~G8jl-DTMCBqoxyB9/</p>

URL: Codeless Deep Learning with KNIME https://kni.me/s/yMp8GBkT0Xwzx5X2
URL: Simple Example for Binary Classification with Keras https://kni.me/w/Cm0lqIKkvThyHAD-
URL: Your First Deep Learning Project in Python with Keras Step-By-Step https://machinelearningmastery.com/tutorial-first-neural-network-python-keras/
URL: please download the complete DeepLearning (Keras, Tensorflow, H2O.ai) Workflow group https://hub.knime.com/mlauber71/spaces/Public/latest/kn_example_deeplearning_keras_tensorflow_classification~G8jl-DTMCBqoxyB9/
URL: (official) KNIME Python Integration Guide https://docs.knime.com/latest/python_installation_guide/index.html#_introduction
URL: Meta Collection about KNIME and Python https://kni.me/w/AvjrddXKOIoZYLV3
URL: (official) KNIME Deep Learning Integration Installation Guide https://docs.knime.com/latest/deep_learning_installation_guide/index.html#_introduction
URL: you will need a working Anaconda oder Miniconda installation https://docs.conda.io/en/latest/miniconda.html
URL: forum - use conda environment propagation to set up python deep learning https://forum.knime.com/t/attributeerror-module-keras-optimizers-has-no-attribute-adam/38461/3?u=mlauber71
URL: Medium: KNIME and Python — Setting up and managing Conda environments https://medium.com/@mlxl/knime-and-python-setting-up-and-managing-conda-environments-2ac217792539

Define network strucuture and train the network. Please note: this is just an example.
You might have to come up with your own architecture.

A simple deep learning network for binary classification using the KNIME Keras integration (with a Python environment propagation)
Please note this example should demonstrate how to set up the deep learning environment with Keras and provide a working simple example.

Adapted from: https://kni.me/w/Cm0lqIKkvThyHAD-

"This workflow trains a fully connected, feedforward network using the adult dataset."

please download the complete DeepLearning (Keras, Tensorflow, H2O.ai) Workflow group:
https://hub.knime.com/mlauber71/spaces/Public/latest/kn_example_deeplearning_keras_tensorflow_classification~G8jl-DTMCBqoxyB9/

these nodes should make sure you have a running Keras / Deep Learning ready Python environment in Windows or MacOSX

if the complicated Model Quality Metanode does not work you can stick to the
"Binary Classification Inspector" node

# you will need a working Miniforge or Miniconda installation
# please note - the popular Anaconda package has changed its licensing recently.
# So make sure you comply with that. Or use Miniforge with conda-forge for the time being
# https://docs.conda.io/en/latest/miniconda.html

# check the conda environments
conda info --envs

KNIME and Python — Setting up and managing Conda environments
https://medium.com/@mlxl/knime-and-python-setting-up-and-managing-conda-environments-2ac217792539

KNIME Python Integration Guide
https://docs.knime.com/latest/python_installation_guide/index.html#_introduction

Meta Collection about KNIME and Python
https://kni.me/w/AvjrddXKOIoZYLV3

KNIME Deep Learning Integration Installation Guide
https://docs.knime.com/latest/deep_learning_installation_guide/index.html#_introduction

Python Conda environment propagation. Please read this article for more details:


KNIME and Python — Setting up and managing Conda environments
https://medium.com/p/2ac217792539


KNIME and Python — Setting up Deep Learning Environments for Keras and TensorFlow 

https://medium.com/p/4b66003858f4

Apply trained network and extract predictions

macOS version is work in progress

Keras Network Reader
../model/*.h5
List Files/Folders
../data/deep_005_test.table
Table Reader
train=> convert binary/string target tonumber
String to Number (PMML)
Activate Conda Environmentbased on Operating SystemWindows or macOSconfigure how to handle the environmentdefault = just check the names
py37_knime_dl_cpu
../data/deep_009_validate.table
Table Reader
validate
PMML Transformation Apply
URL to File Path
test
PMML Transformation Apply
GroupBy
Write modelknime://knime.workflow/../model/adult_keras_basic.h5
Keras Network Writer
Keras Network Learner
get the numberof feature columns
Table Column to Variable
RowID
Binary Classification Inspector
Number (double)
Row Filter (deprecated)
ReLU, 6 Units
Keras Dense Layer
apply trainednetwork
Keras Network Executor
Sigmoid; 1 Unit
Keras Dense Layer
Inputsthe number of inputs is dynamically basedon the number of variables
Keras Input Layer
^(.*submission|solution).*$
Column Filter
Path to URI
Relu; 6 Units
Keras Dense Layer
solutionto string
Number to String
Table Row to Variable
Extract Table Spec
Column Rename (deprecated)
number of Rows
Table Column to Variable
../data/deep_001_training.table
Table Reader
Extract Table Dimension

Nodes

Extensions

Links