Limited Availability
← Gnok home

Score transactions as they arrive

Which transactions deserve a second look? Run a classifier and an anomaly detector on the same stream. One estimates fraud risk from labeled history. The other measures how unusual the amount is compared with recent activity.

Of 32 sample transactions, the first 31 have amounts between 60 and 140. The last transaction has an amount of 9,500.
Amounts in transaction-ID order from the synthetic tutorial. The five-minute anomaly detector flagged transaction 1002.

Follow a new event

An append-only stream captures new rows in the transactions table. The model takes amount, transaction frequency and distance as inputs. The scoring query scales those inputs the same way they were scaled during training.

Each prediction carries its transaction ID, so an analyst can join it back to the event. Read about streaming ingestion

Compare the two signals

After 30 baseline events, the tutorial adds two probes and refreshes the streams. Transaction 1001 scored about 0.114. Transaction 1002 scored nearly 1 and its amount triggered the moving-average detector. Those signals give a reviewer a reason to investigate.

SQL worksheet showing a query over the transaction stream and 32 rows in its results.
The worksheet also scores the source rows directly so you can compare them with the stored stream predictions by transaction ID.

Run the scoring and anomaly tutorial