All walkthroughs

Transaction analysis project: build an explainable review queue

Run Python rules against 24 synthetic transactions. Download the input, review queue, code, and chart, and distinguish a review signal from a fraud finding.

Worked example by the Innovatech team ·

Synthetic teaching data generated for this example. No customer or student records are included.

The question

Which transactions should an analyst review first, and can each flag be traced to an explicit rule?

Work through the analysis

  1. Define the review rules

    Flag an amount of at least €1,000 on a new device, or the third or later payment from one account within ten minutes. These thresholds are teaching choices, not calibrated production controls.

  2. Sort before using a time window

    Parse timestamps and sort the records. For each account, retain payments within the preceding ten minutes. Add a record to the review queue when either rule fires, retaining the transaction ID and reasons.

  3. Inspect the calculated queue

    The supplied 24 transactions produce four review records. Three match the large-amount/new-device rule; one matches the repeated-payment rule. Open review-queue.csv to inspect each transaction and reason.

Calculated results

transactions
24
review records
4
explicit rules
2
Chart calculated from the supplied synthetic data. Labels are in English.
Chart calculated from the supplied synthetic data. Labels are in English.
Inspect the output
TransactionSynthetic accountRevenue (EUR)Review signals
TXN-005ACCT-051500.00Large amount and new device
TXN-010ACCT-DEMO120.00Repeated payments within ten minutes
TXN-012ACCT-041500.00Large amount and new device
TXN-019ACCT-031500.00Large amount and new device

What the result can and cannot tell you

A flag requests review. It does not establish fraud. There are no verified fraud labels, so precision, recall, and detection accuracy cannot be calculated. An unflagged transaction is not proven safe. A production system would need independently labeled cases, validated thresholds, and review of missed cases.

Move TXN-010 outside the ten-minute window and rerun the code. Explain why the queue changes. Then change the amount threshold and document which records move in or out.

Download and reproduce

Run locally with Python 3

python3 analyze.py --input input.csv --output results

Uses Python 3 and its standard library. No API keys or additional packages are required.

Build work you can explain

Create a learner account to request access to guided projects. Review prerequisites and access conditions before choosing a course.

TURN YOUR WORK INTO OPPORTUNITY

Tell the story of your project