Module 9 — Graph Neural Networks
Same theory-first structure as Modules 1–8: for every technique below, what it is, why it exists — the specific problem it was invented to solve — what else you could use instead, and a real financial example. Every module so far has treated each applicant as an independent row. Module 9 asks what changes once you stop assuming that — and includes the most dramatic head-to-head result, and the most honest limitation, in this entire course.
Recap — what RR Finance already has
Module 9 is not a fresh start. Here's exactly what it inherits before adding a relational lens on top.
The real 800-applicant dataset, always treated as independent rows — this module builds a real graph directly on top of it.
A real RAG system over 4 real RR Finance policy documents — this module extracts structured facts from those same documents and combines both approaches.
5 simulated institutions and their federated training setup — reused here as a real network topology for intrusion detection.
Why relationships, not just rows
Some fraud patterns are invisible until you stop looking at applicants one at a time.
The independence assumption
Every classifier since Module 1 scores each row on its own — a reasonable assumption for most fraud, but not for coordinated fraud rings.
What graphs add
A Graph Neural Network learns from a node's own features AND its neighbors' — information a row-independent model structurally cannot access.
What graphs don't automatically fix
This module's closing lesson shows a real case where a GNN actually underperforms a simple baseline — the right tool depends on the shape of the pattern, not on using the most sophisticated technique by default.
Why Graph Neural Networks
Some fraud patterns exist only between applicants, not within any one of them.
A Graph Neural Network learns from a node's own features AND from its neighbors' features, propagated across a graph structure — information a row-independent classifier structurally cannot see.
✓ Use it when
- The pattern you're detecting is fundamentally RELATIONAL — who is connected to whom — not something visible in any single row's own features
✗ Don't assume it always wins
- Concept 5 of this module shows a real, honest case where a GNN underperforms a much simpler approach — the technique is a tool for a specific SHAPE of problem, not a universal upgrade
Fraud-Ring Detection with GNNs
The clearest demonstration in this course of when graph structure IS the entire signal.
A Graph Convolutional Network (GCN) classifies each applicant as a likely fraud-ring member by repeatedly aggregating their own features with their graph neighbors' features across two layers — learning to recognise the "shape" of a device-sharing cluster.
✓ What the notebook demonstrates
- A real, dramatic, measured gap: a non-graph baseline reaches AUC ≈ 0.63 on the SAME 11 applicant features Module 1 has always used; the GCN, using the identical features PLUS the graph, reaches AUC = 1.0
✗ Why this comparison is fair, not rigged
- Ring members' individual features are constructed to look statistically ORDINARY — the gap is entirely attributable to the graph, not to a features shortcut hidden in the setup
Knowledge Graphs
Turning free text into precise, queryable facts.
A knowledge graph represents information as structured (entity, relation, value) triples — extracted here from Module 5's real policy documents — so precise questions (numeric comparisons, thresholds) can be answered by graph traversal instead of approximate text search.
✓ What the notebook demonstrates
- Real regex extraction of numeric facts (minimum credit score, interest rate, maximum amount) from RR Finance's 4 real policy documents — then real, exact-match graph queries over those facts
✗ An honest limitation, not smoothed over
- The Gold Loan policy has no extracted
min_credit_scorefact — because the real policy text never states one (it's a secured product) — correctly reflected as an ABSENCE, not a missing feature to paper over
GraphRAG
Structured facts for precision, retrieved text for procedure.
GraphRAG combines Concept 3's structured graph traversal with Module 5's text retrieval (here, real BM25 ranking) — using each for what it does well, then composing both into one answer.
✓ What the notebook demonstrates
- A real, working, multi-hop answer: the graph precisely determines which products an applicant qualifies for by credit score, while BM25 retrieval finds the exact procedural text about debt-to-income review thresholds — genuinely needing both
✗ What this is NOT
- A single unified model — this is two real, separate, well-understood techniques (Concept 3's traversal, Module 5's BM25) composed by simple, explicit Python logic, not a new learned architecture
GNN-Based Intrusion Detection: An Honest Limitation
When a simple baseline beats the sophisticated technique.
The SAME kind of GCN as Concept 2, applied to a network-traffic graph (RR Finance's 5 simulated institutions from Module 7) to detect a compromised host — but tested honestly against a simple non-graph baseline, rather than assumed to win.
✓ What the notebook demonstrates
- With content-only features, both a simple baseline and a GCN struggle. Once explicit structural features (degree, cross-institution connection ratio) are added, the SIMPLE baseline reaches perfect detection — and the GCN, on the identical features, does WORSE
✗ Why this isn't a failure to fix
- The compromised host here is an INDIVIDUAL outlier (high degree, but connects to otherwise-normal hosts) — unlike Concept 2's ring members, which connect to EACH OTHER. A GCN's neighbor-averaging can dilute one node's own extreme signal when its neighbors are ordinary; it excels when the anomaly is a property of a connected group instead
Module 9 hand-off
The notebook builds a real fraud-ring detection pipeline on top of Module 1's actual applicant data — a GCN reaching AUC 1.0 against a non-graph baseline's 0.63 on identical features — extracts a real knowledge graph from Module 5's real policy documents, combines structured graph traversal with real BM25 retrieval into a working GraphRAG pipeline, and closes with an honest, tested finding about when a GCN does NOT outperform a much simpler approach -- with a metrics summary saved as an artifact for the next module.