Design an Inductive, Time-Aware Split for a Marketplace Graph
You have 120 days of events from a two-sided marketplace graph: buyer and seller accounts as nodes, transactions as timestamped edges. Accounts are labelled "fraudulent" by a review process and chargebacks that mature 30 days after the account's first transaction. New accounts join every day. A colleague has already trained a GNN with a random 80/20 split of nodes and reports PR-AUC 0.90.
- Explain three distinct ways the random node split leaks.
- Design the split: snapshot days, which nodes are labelled in train, validation and test, and which edges each model may see.
- State what "inductive" requires of the model and which of (a) free per-node embeddings, (b) GCN fit on one fixed adjacency, (c) GraphSAGE with attribute inputs, (d) a GBM on as-of graph features qualify.
- List the slices you would report in addition to the pooled metric.
1. Three leaks. (i) Future structure: in a random split, the neighbourhood of a training node contains edges that happened after the test nodes were created, so the model sees the future. (ii) Label proximity: fraud rings are groups of connected nodes; a random split puts ring mates in both train and test, and any model (or a neighbour-label feature) can infer the label from the training mates. In the lesson's experiment a random node split with neighbour-label features gave PR-AUC 0.850 while the same family of features restricted to labels known as of training time gave 0.508. (iii) Cold start hidden: all test nodes have rich neighbourhoods and appear in the graph at training time, while in production new accounts arrive with no history. 98.6 percent of test endpoints were "seen" in the random-split link experiment against 32.4 percent in the time split.
2. The split. Because labels mature after 30 days, a node can be labelled for training only if its first transaction was at least 30 days before the training cut-off. Use two snapshots and three node groups:
- Train: snapshot T_1 = 60. Graph = edges with timestamp before day 60. Labelled training nodes = accounts that first transacted on days 0 to 24 (labels mature by day 54). Accounts joining on days 30 to 59 stay in the graph, unlabelled, as neighbours.
- Validation: the same snapshot, with accounts that joined on days 25 to 29 (labels mature by day 59) held out of training for early stopping and thresholds.
- Test: snapshot T_2 = 120. Graph = edges before day 120, which includes new accounts, new edges and rings that did not exist at T_1. Test nodes = accounts that first transacted on days 60 to 89 (their labels mature by day 119), scored with the day-120 graph. Their features and neighbourhoods are computed as of T_2, and none of the test accounts' own labels or their neighbours' not-yet-matured labels is used anywhere.
The test graph is larger than the training graph; features that scale with size (PageRank, raw counts) should be normalised or windowed so that the two snapshots are comparable. Report results over several random seeds (the lesson's seeds gave PR-AUC spreads of 0.04 to 0.08).
3. What inductive requires. A function from a node's attributes and neighbourhood to a prediction that can be applied to nodes and edges not present in training. (a) Free per-node embeddings do not qualify: there is no vector for a new node and two fits give different coordinate systems (measured mean same-node cosine 0.397 between snapshots). (b) A GCN fit on one fixed adjacency matrix does not, unless re-run on the new graph and re-trained. (c) GraphSAGE with attribute inputs does: the learned weights apply to any node given its features and neighbours. (d) A GBM on as-of graph features does, as long as the features are computed by the same function on each snapshot.
4. Slices. By account age at scoring (isolated or fewer than 3 edges, versus established), by degree bucket (hubs are different), by ring versus lone fraud, by seller versus buyer, and by whether the account's neighbourhood existed at the training snapshot. In the synthetic example 62.2 percent of test accounts had no edges at the training snapshot, so a pooled number hides the performance on the population fraud teams care about most.
Share this question