Icon

02_​MONITOR

The monitor decides and the monitor calls. 02_MONITOR sees the drift and starts 01_TRAIN itself. The registry/ folder is the only thing the two of them share.

1 Which model is in production

Never told which model to use: it reads registry.csv, takes the highest version and loads the file that row points at.
Red here means the registry is not there yet — nobody has trained a v1. Run 01_TRAIN once, then press this one again.

Ask the registry, do not assume

2 Which batch is next

Never told which batch to score either. It takes the newest row of monitor_log.csv: RETRAIN → score that same batch again, anything else → move on one.

Ask the log, do not be told

3 Score it

acc is how often the model was right; lost is that against the accuracy this version was accepted at.

Two numbers, and only one of them is new

4 Decide and log

Lost more than 20 → RETRAIN. A newer model than the one on the last row → REVIEW: the retrain's report card, which decides nothing.

One threshold, one row in the log

5 Retrain, from here

The monitor does not report the retrain, it performs it. The IF Switch deactivates the branch not chosen, so on HOLD the Call node never runs.

The monitor decides and the monitor calls

The loop closes inside KNIME. On RETRAIN this workflow calls 01_TRAIN itself, with train_upto set to the batch that just failed. A new version lands in the registry, and the very next press — same nodes, nothing edited — scores that same batch again with it and writes a REVIEW row. That second row is the retrain's report card, measured on the data that triggered it.

So a batch appears twice in monitor_log.csv, and that is correct. The rule fires at batches 2, 7, 8 and 9, so the log is 13 rows for 9 batches. Press once more after batch 10 and the Breakpoint says the data has run out.

Batch 8 is the row to read twice: there the retrain made it worse, 48.6 → 47.3. The log says so instead of hiding it — README.md.

Data: UCI Machine Learning Repository, record 224, "Gas Sensor Array Drift Dataset"https://doi.org/10.24432/C5RP6WVergara, A., Vembu, S., Ayhan, T., Ryan, M. A., Homer, M. L., & Huerta, R. (2012).Chemical gas sensor drift compensation using classifier ensembles.Sensors and Actuators B: Chemical, 166-167, 320-329.Collected January 2007 to February 2011 specifically to study sensor drift.data/gas_sensor_16.csv keeps one column per sensor - the normalised steady-stateresponse f002, f010 ... f122 - plus batch_id, row_id and gas_name.

The fast clock — two numbers that need no labels, and decide nothing

data_shift = mean over the 16 sensors of |mean now − mean ref| / sd ref pred_shift = |yes-share now − yes-share on the reference window|, in points

Both are read against that version's own profile_v<N>.csv, and both are written into monitor_log.csv. Neither one touches the IF Switch. The decision is still lost > 20, and lost needs the labels.

And that is the lesson, not a shortcut left out. On this run each fast signal's RETRAIN range OVERLAPS its own non-RETRAIN range, so neither gives a threshold; the numbers are in README.md. A fast signal says something changed, only the slow one says the model got it wrong.

Node 1Read the registry
CSV Reader
Node 2Highest version to the top
Sorter
Node 3Four facts about production
Table Row to Variable
Node 4Load that model file
Model Reader
Node 513,910 rows16 sensors, 10 batches
CSV Reader
Node 6Keep the batch to score
Rule-based Row Filter
Node 7Production model scores it
Logistic Regression Predictor
Node 24The log's columns,no rows
Table Creator
Node 25Make monitor_log.csv exist
CSV Writer
Node 22The drift timeline
Python View
Node 23Which gases did it lose?
Bar Chart
Node 28The newest row wins
GroupBy
Node 29Two facts about the log
Table Row to Variable
Node 26Read the log, no header
CSV Reader
Node 27RETRAIN? score it again
Expression
Node 31The version's own profile
CSV Reader
Node 10New model? Review it
Expression
Node 3216 columns -> 16 rows
Unpivot
Node 30Nothing left? Say so
Breakpoint
Node 8Right or wrong, row by row
Expression
Node 13The retrain order
Expression
Node 35Distance in sd, per sensor
Expression
Node 9One row: acc and lost
GroupBy
Node 14train_upto must be an int
Math Formula
Node 36Average it: data_shift
GroupBy
Node 11Append to monitor_log.csv
CSV Writer
Node 33This batch, sensor by sensor
GroupBy
Node 12Where the registry sits
Extract Context Properties
Node 34Now beside the reference
Joiner
Node 17The six things it sends
Table Row to Variable
Node 18Call 01_TRAIN, now
Call Workflow Service
Node 15Which way the switch goes
Table Row to Variable
Node 37Hand them to the log
Table Row to Variable
Node 16RETRAIN leaves here
IF Switch
Node 38The two clocks together
Python View

Nodes

Extensions

Links