[Paper Review] Supervised Learning on Relational Databases with Graph Neural Networks
This paper proposes a Graph Neural Network (GNN)-based method for supervised learning directly on relational databases without flattening or manual feature engineering. By modeling tables and foreign key relationships as a heterogeneous graph, the approach preserves relational structure and outperforms state-of-the-art automatic feature engineering on two out of three benchmark datasets, demonstrating the effectiveness of GNNs in leveraging relational data for machine learning.
The majority of data scientists and machine learning practitioners use relational data in their work [State of ML and Data Science 2017, Kaggle, Inc.]. But training machine learning models on data stored in relational databases requires significant data extraction and feature engineering efforts. These efforts are not only costly, but they also destroy potentially important relational structure in the data. We introduce a method that uses Graph Neural Networks to overcome these challenges. Our proposed method outperforms state-of-the-art automatic feature engineering methods on two out of three datasets.
Motivation & Objective
- To address the high cost and structural loss associated with traditional feature engineering when training ML models on relational databases.
- To enable end-to-end learning directly on normalized, normalized relational database (RDB) schemas without data flattening.
- To evaluate whether GNNs can effectively exploit relational structure in RDBs to improve predictive performance over standard feature engineering approaches.
- To explore the impact of relational complexity (number of tables and foreign keys) on GNN performance.
Proposed method
- The method constructs a heterogeneous graph from the RDB schema, where tables are node types and foreign key relationships are directed edges between them.
- Each row in a table is embedded as a node in the graph, with features derived from column values, and foreign key references are modeled as edges connecting nodes across tables.
- A GNN model (GCN, GIN, GAT, or their entity-relational variants) performs message passing across the graph to learn contextualized node representations.
- The final prediction is made using a readout layer applied to the target table's nodes, with the model trained via empirical risk minimization using cross-entropy loss.
- The approach includes a stacking strategy that combines GNN pre-logits with tabular features via a GBDT to mitigate overfitting and improve performance.
- The method is evaluated on three real-world RDBs: Acquire Valued Shoppers, Home Credit Default Risk, and KDD Cup 2014, using AUROC as the primary metric.
Experimental results
Research questions
- RQ1Can GNNs effectively learn from relational databases without flattening or manual feature engineering, and how does performance compare to state-of-the-art feature engineering methods?
- RQ2Does the relational complexity of a database (number of tables and foreign key relationships) correlate with the performance gain of GNN-based models?
- RQ3Does the use of entity-relational message passing in GNNs provide a significant advantage over standard GNNs on relational data?
- RQ4Can stacking GNN outputs with traditional tabular models further improve performance on relational learning tasks?
- RQ5Why do GNNs underperform on the KDD Cup 2014 dataset despite strong performance on the other two, and what does this imply about the data's relational structure?
Key findings
- On the Acquire Valued Shoppers Challenge dataset, the best GNN variant (ERGCN) achieved an AUROC of 0.040 ± 0.002, significantly outperforming the best baseline (DFS + GBDT) at 0.027 ± 0.002.
- On the Home Credit Default Risk dataset, the ERGCN model achieved an AUROC of 0.030 ± 0.002, exceeding the best baseline (DFS + GBDT) at 0.029 ± 0.002.
- On the KDD Cup 2014 dataset, no GNN variant outperformed the best baseline, with all models achieving AUROC values around 0.013–0.015, suggesting limited relational signal in this dataset.
- The performance of GNNs strongly correlates with relational complexity: datasets with more tables and foreign key relationships (e.g., Acquire and Home Credit) saw greater gains, while the less relational KDD Cup 2014 dataset showed no benefit.
- Stacking GNN predictions with a GBDT improved performance on some datasets but did not yield consistent gains, and no single GNN architecture consistently outperformed others across all datasets.
- The study suggests that GNNs are most effective when relational structure is rich and informative, and that transfer learning potential via pre-trained text embeddings could further enhance performance on text-heavy RDBs.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.