dbinfer-amazon
Amazon from the 4DBInfer benchmark: a large product-review dataset linking users, products and reviews, used for rating prediction and user purchase/churn prediction.
Schema
Tasks
| task | kind | type | description |
|---|---|---|---|
churn |
external | binary_classification | Predict whether a customer churns (stops reviewing/purchasing). |
purchase |
external | link_prediction | Rank products a customer will purchase. 4DBInfer's MRR retrieval protocol: train holds positives only; val/test enumerate candidates with label and query_idx. Score with MRR over those candidates -- RelBench's default link metric (MAP) is a different protocol. |
rating |
external | regression | Predict the star rating a customer gives a product (product_id names the product; 4DBInfer scores this as regression/RMSE). |
Port notes
Built from the original 4DBInfer archive (https://data.dgl.ai/mtbench/20240304-amazon.tar), keeping exactly the columns its metadata.yaml declares. Primary keys are reindexed to 0..n-1 and every foreign key -- in the database and in the task labels -- is remapped through the same mapping.
4DBInfer links some foreign keys to key domains that have no payload table of their own; those are materialized here as single-column key tables: Customer.
Undeclared payload columns dropped:
Customer:customer_name
Label columns in the database
4DBInfer derives some labels from a column that is itself part of the database, so a model reading that row could read its own label:
purchase->Review.product_idrating->Review.rating
Each such task declares remove_columns, and the column is left in db/ so the database stays faithful to the source. Dataset.get_db drops the declared pairs, so relbench.load_task(...) hands you a graph without them -- for every task kind, not just autocomplete. If you read the parquet directly, drop them yourself.
Known upstream defects
The three tasks are split at different points in time (churn from 2015-10-03,
purchase from 2015-12-29, rating from 2015-12-30). The dataset-level
val_timestamp/test_timestamp take the earliest of each, so trimming the database at a
cutoff is conservative for every task rather than exact for one.
Loading
import relbench
ds = relbench.load_dataset("relbench/dbinfer/dbinfer-amazon")
task = relbench.load_task("relbench/dbinfer/dbinfer-amazon", "<task>")
Citation
Original dataset: 4DBInfer (NeurIPS 2024).
@inproceedings{wang2024fourdbinfer,
title = {{4DBInfer}: A {4D} Benchmarking Toolbox for Graph-Centric Predictive Modeling on Relational Databases},
author = {Wang, Minjie and Gan, Quan and Wipf, David and Cai, Zhenkun and Li, Ning and Tang, Jianheng and Zhang, Yanlin and Zhang, Zizhao and Mao, Zunyao and Song, Yakun and Wang, Yanbo and Li, Jiahang and Zhang, Han and Yang, Guang and Qin, Xiao and Lei, Chuan and Zhang, Muhan and Zhang, Weinan and Faloutsos, Christos and Zhang, Zheng},
booktitle = {Advances in Neural Information Processing Systems 37 (NeurIPS 2024) Datasets and Benchmarks Track},
year = {2024}
}
If you use this dataset as hosted by RelBench, please also cite RelBench:
@inproceedings{robinson2024relbench,
title = {{RelBench}: A Benchmark for Deep Learning on Relational Databases},
author = {Robinson, Joshua and Ranjan, Rishabh and Hu, Weihua and Huang, Kexin and Han, Jiaqi and Dobles, Alejandro and Fey, Matthias and Lenssen, Jan E. and Yuan, Yiwen and Zhang, Zecheng and He, Xinwei and Leskovec, Jure},
booktitle = {Advances in Neural Information Processing Systems 37 (NeurIPS 2024) Datasets and Benchmarks Track},
year = {2024}
}