Knime Analytics
Advanced Training Part-3
itsmecevi.github.io
Workflow Control�Loops, Switches, Try-Catch
2
These slides are a derivative of KNIME Course Material of KNIME AG used under CC BY-NC-SA 4.0.
These slides are a derivative of KNIME Course Material of KNIME AG used under CC BY-NC-SA 4.0.
Workflow Control Structures
3
These slides are a derivative of KNIME Course Material of KNIME AG used under CC BY-NC-SA 4.0.
The Loop Block
4
Loop start node
Loop end node
Loop body
These slides are a derivative of KNIME Course Material of KNIME AG used under CC BY-NC-SA 4.0.
New Node: Group Loop Start
5
These slides are a derivative of KNIME Course Material of KNIME AG used under CC BY-NC-SA 4.0.
New Node: Create File Name
6
These slides are a derivative of KNIME Course Material of KNIME AG used under CC BY-NC-SA 4.0.
Example: Writing aggregated files
7
These slides are a derivative of KNIME Course Material of KNIME AG used under CC BY-NC-SA 4.0.
Workflow Control Exercise, Activity I
Start with exercise: Workflow Control, Activity I
8
(Hint: Group Loop Start creates a flow variable naming the current group)
These slides are a derivative of KNIME Course Material of KNIME AG used under CC BY-NC-SA 4.0.
New Node: List Files
9
These slides are a derivative of KNIME Course Material of KNIME AG used under CC BY-NC-SA 4.0.
New Node: Table Row to Variable Loop Start
10
These slides are a derivative of KNIME Course Material of KNIME AG used under CC BY-NC-SA 4.0.
Example: Reading Many Files
11
These slides are a derivative of KNIME Course Material of KNIME AG used under CC BY-NC-SA 4.0.
Workflow Control Exercise, Activity II
Start with exercise: Workflow Control, Activity II
12
These slides are a derivative of KNIME Course Material of KNIME AG used under CC BY-NC-SA 4.0.
Switches
13
Active
Inactive
These slides are a derivative of KNIME Course Material of KNIME AG used under CC BY-NC-SA 4.0.
New Node: Single Selection
14
These slides are a derivative of KNIME Course Material of KNIME AG used under CC BY-NC-SA 4.0.
New Node: Rule Engine/Rule Engine Variable
15
These slides are a derivative of KNIME Course Material of KNIME AG used under CC BY-NC-SA 4.0.
New Node: If Switch
16
These slides are a derivative of KNIME Course Material of KNIME AG used under CC BY-NC-SA 4.0.
New Nodes: Case Switch Data
17
These slides are a derivative of KNIME Course Material of KNIME AG used under CC BY-NC-SA 4.0.
The Difference between Loops and Switches
Loops
Switches
18
These slides are a derivative of KNIME Course Material of KNIME AG used under CC BY-NC-SA 4.0.
Workflow Control Exercise, Activity III
19
These slides are a derivative of KNIME Course Material of KNIME AG used under CC BY-NC-SA 4.0.
Try-Catch
20
These slides are a derivative of KNIME Course Material of KNIME AG used under CC BY-NC-SA 4.0.
Streaming
21
These slides are a derivative of KNIME Course Material of KNIME AG used under CC BY-NC-SA 4.0.
Streaming
22
These slides are a derivative of KNIME Course Material of KNIME AG used under CC BY-NC-SA 4.0.
Advanced Data Mining�Random Forest, Tree Ensembles, Parameter Optimization, Cross Validation
23
These slides are a derivative of KNIME Course Material of KNIME AG used under CC BY-NC-SA 4.0.
These slides are a derivative of KNIME Course Material of KNIME AG used under CC BY-NC-SA 4.0.
Overview
24
These slides are a derivative of KNIME Course Material of KNIME AG used under CC BY-NC-SA 4.0.
KNIME’s Tree Ensemble Models
25
Typically: for classification the individual models vote and the majority wins; for regression, the individual predictions are averaged
X
…
1
5
2
2
9
6
7
4
2
7
6
8
9
3
1
7
6
3
9
5
7
y
P1
P2
Pn
…
These slides are a derivative of KNIME Course Material of KNIME AG used under CC BY-NC-SA 4.0.
How Does Bagging Work?
26
…
1
5
2
2
9
6
7
4
5
7
2
8
9
3
1
7
6
3
9
5
7
…
Build tree
Build tree
Build tree
These slides are a derivative of KNIME Course Material of KNIME AG used under CC BY-NC-SA 4.0.
An Extra Benefit of Bagging: Out of Bag Estimation
27
X2
…
1
5
2
2
9
6
7
4
2
7
6
8
9
3
1
7
6
3
9
5
7
y2OOB
P1
P2
Pn
…
X1
…
1
5
2
2
9
6
7
4
2
7
6
8
9
3
1
7
6
3
9
5
7
P1
P2
Pn
…
y1OOB
These slides are a derivative of KNIME Course Material of KNIME AG used under CC BY-NC-SA 4.0.
Random Forest
28
1
5
2
2
9
6
7
Build tree
These slides are a derivative of KNIME Course Material of KNIME AG used under CC BY-NC-SA 4.0.
New Nodes: Random Forest Learner
29
These slides are a derivative of KNIME Course Material of KNIME AG used under CC BY-NC-SA 4.0.
New Nodes: Random Forest
30
These slides are a derivative of KNIME Course Material of KNIME AG used under CC BY-NC-SA 4.0.
Tree Ensembles
31
These slides are a derivative of KNIME Course Material of KNIME AG used under CC BY-NC-SA 4.0.
Tree Ensembles
32
These slides are a derivative of KNIME Course Material of KNIME AG used under CC BY-NC-SA 4.0.
New Nodes: Tree Ensemble Learner/Predictor
33
These slides are a derivative of KNIME Course Material of KNIME AG used under CC BY-NC-SA 4.0.
New Node: Gradient Boosted Trees Learner
34
These slides are a derivative of KNIME Course Material of KNIME AG used under CC BY-NC-SA 4.0.
Advanced Data Mining Exercise, Activity I
Start with exercise: Advanced Data Mining, Activity I
35
These slides are a derivative of KNIME Course Material of KNIME AG used under CC BY-NC-SA 4.0.
Parameter Optimization
36
These slides are a derivative of KNIME Course Material of KNIME AG used under CC BY-NC-SA 4.0.
New Node: Parameter Optimization Loop Start
37
These slides are a derivative of KNIME Course Material of KNIME AG used under CC BY-NC-SA 4.0.
New Node: Parameter Optimization Loop End
38
These slides are a derivative of KNIME Course Material of KNIME AG used under CC BY-NC-SA 4.0.
Advanced Data Mining Exercise, Activity II
Start with exercise: Advanced Data Mining, Activity II
(Hint: don’t forget to use the flow variable in your learner)
39
These slides are a derivative of KNIME Course Material of KNIME AG used under CC BY-NC-SA 4.0.
Cross Validation
40
These slides are a derivative of KNIME Course Material of KNIME AG used under CC BY-NC-SA 4.0.
Example: Cross Validation
41
These slides are a derivative of KNIME Course Material of KNIME AG used under CC BY-NC-SA 4.0.
Advanced Data Mining Exercise, Activity III
Start with exercise: Advanced Data Mining, Activity III
42
These slides are a derivative of KNIME Course Material of KNIME AG used under CC BY-NC-SA 4.0.
H2O Integration
43
These slides are a derivative of KNIME Course Material of KNIME AG used under CC BY-NC-SA 4.0.
H2O Integration - Example
44
Starting point: create local H2O context
Add data from KNIME to H2O
Model training and prediction
Data import
Scoring
These slides are a derivative of KNIME Course Material of KNIME AG used under CC BY-NC-SA 4.0.
Deep Learning Integration
45
These slides are a derivative of KNIME Course Material of KNIME AG used under CC BY-NC-SA 4.0.
Sentiment Analysis Using Keras
46
These slides are a derivative of KNIME Course Material of KNIME AG used under CC BY-NC-SA 4.0.
Databases�
47
These slides are a derivative of KNIME Course Material of KNIME AG used under CC BY-NC-SA 4.0.
These slides are a derivative of KNIME Course Material of KNIME AG used under CC BY-NC-SA 4.0.
Database Extension
48
These slides are a derivative of KNIME Course Material of KNIME AG used under CC BY-NC-SA 4.0.
Database Port Types
49
Database JDBC Connection Port (red)
Database Connection Port (brown)
Database Connection Ports can be connected to
Database JDBC Connection Ports
but not vice versa
These slides are a derivative of KNIME Course Material of KNIME AG used under CC BY-NC-SA 4.0.
Database Table Selector
50
These slides are a derivative of KNIME Course Material of KNIME AG used under CC BY-NC-SA 4.0.
Database Connection Table Reader
51
Database Connection Port
KNIME Data Table
These slides are a derivative of KNIME Course Material of KNIME AG used under CC BY-NC-SA 4.0.
Database Connectors
52
These slides are a derivative of KNIME Course Material of KNIME AG used under CC BY-NC-SA 4.0.
Dedicated Database Connectors
53
These slides are a derivative of KNIME Course Material of KNIME AG used under CC BY-NC-SA 4.0.
«General» Database Connector Node
54
Database type defines SQL dialect
These slides are a derivative of KNIME Course Material of KNIME AG used under CC BY-NC-SA 4.0.
Register JDBC Driver
55
Open KNIME and go to File -> Preferences
Increase connection timeout for long running database operations
Register single jar file JDBC drivers
Register new JDBC driver with companion files
These slides are a derivative of KNIME Course Material of KNIME AG used under CC BY-NC-SA 4.0.
In-Database Processing
56
These slides are a derivative of KNIME Course Material of KNIME AG used under CC BY-NC-SA 4.0.
Query Nodes
57
These slides are a derivative of KNIME Course Material of KNIME AG used under CC BY-NC-SA 4.0.
58
Data Aggregation
Aggregated on “Group” by method:
sum(“Value”)
RowID | Group | Value |
r1 | m | 2 |
r2 | f | 3 |
r3 | m | 1 |
r4 | f | 5 |
r5 | f | 7 |
r6 | m | 5 |
RowID | Group | Sum(Value) |
r1+r3+r6 | m | 8 |
r2+r4+r5 | f | 15 |
These slides are a derivative of KNIME Course Material of KNIME AG used under CC BY-NC-SA 4.0.
Database GroupBy
59
These slides are a derivative of KNIME Course Material of KNIME AG used under CC BY-NC-SA 4.0.
Database GroupBy
60
Returns number of rows per group
These slides are a derivative of KNIME Course Material of KNIME AG used under CC BY-NC-SA 4.0.
Database GroupBy – DB Specific Aggregation Methods
61
PostgreSQL: 25 aggregation functions
SQLite: 7 aggregation functions
These slides are a derivative of KNIME Course Material of KNIME AG used under CC BY-NC-SA 4.0.
Database Joiner
62
These slides are a derivative of KNIME Course Material of KNIME AG used under CC BY-NC-SA 4.0.
Database Row Filter
63
These slides are a derivative of KNIME Course Material of KNIME AG used under CC BY-NC-SA 4.0.
Database Sorter
64
These slides are a derivative of KNIME Course Material of KNIME AG used under CC BY-NC-SA 4.0.
Database Query
65
These slides are a derivative of KNIME Course Material of KNIME AG used under CC BY-NC-SA 4.0.
Database Connection Port View
66
Copy SQL statement
These slides are a derivative of KNIME Course Material of KNIME AG used under CC BY-NC-SA 4.0.
Export Data
67
These slides are a derivative of KNIME Course Material of KNIME AG used under CC BY-NC-SA 4.0.
Database Writing Nodes
68
These slides are a derivative of KNIME Course Material of KNIME AG used under CC BY-NC-SA 4.0.
Database Writer
69
Append to or drop existing table
Increase batch size for better performance
These slides are a derivative of KNIME Course Material of KNIME AG used under CC BY-NC-SA 4.0.
Database Update
70
Columns to update
Columns that identify the records to update
Increase batch size for better performance
These slides are a derivative of KNIME Course Material of KNIME AG used under CC BY-NC-SA 4.0.
Database Delete
71
Increase batch size for better performance
These slides are a derivative of KNIME Course Material of KNIME AG used under CC BY-NC-SA 4.0.
Utility
72
Execute queries separated by ; and new line
These slides are a derivative of KNIME Course Material of KNIME AG used under CC BY-NC-SA 4.0.
73
Database Exercise
These slides are a derivative of KNIME Course Material of KNIME AG used under CC BY-NC-SA 4.0.