Skip to main content

RelBench: Relational Deep Learning Benchmark

Project description

logo


website PyPI version Testing Status License: MIT Twitter

Website | Vision Paper | Mailing List

Overview

Relational Deep Learning is a new approach for end-to-end representation learning on data spread across multiple tables, such as in a relational database (see our vision paper). RelBench is the accompanying benchmark which seeks to facilitate efficient, robust and reproducible research in this direction. It comprises of a collection of realistic, large-scale, and diverse datasets structured as relational tables, along with machine learning tasks defined on them. It provides full support for data downloading, task specification and standardized evaluation in an ML-framework-agnostic manner. Additionally, there is seamless integration with PyTorch Geometric to load the data as a graph and train GNN models, and with PyTorch Frame to encode the various types of table columns. Finally, there is a leaderboard for tracking progress.

RelBench is in its beta release stage, and we are planning to increase datasets and benchmarking in the near future. Datasets in the current version are subject to change.

Installation

You can install RelBench using pip:

pip install relbench

Package Usage

Here we describe key functions of RelBench. RelBench provides a collection of APIs for easy access to machine-learning-ready relational databases.

To see all available datasets:

from relbench.dataset import dataset_names
print(dataset_names)

For a concrete example, to obtain the rel-stackex relational database, do:

from relbench.datasets import get_dataset
dataset = get_dataset(name="rel-stackex")

To see the tasks available for this dataset:

print(dataset.task_names)

Next, to retrieve the rel-stackex-votes predictive task, which is to predict the upvotes of a post it will receive in the next 2 years, simply do:

task = dataset.get_task("rel-stackex-votes")
task.train_table, task.val_table, task.test_table # training/validation/testing tables

The training/validation/testing tables are automatically generated using pre-defined standardized temporal split. You can then build your favorite relational deep learning model on top of it. After training and validation, you can make prediction from your model on task.test_table. Suppose your prediction test_pred is an array following the order of task.test_table, you can call the following to retrieve the unified evaluation metrics:

task.evaluate(test_pred)

Additionally, you can evaluate validation (or training) predictions as such:

task.evaluate(val_pred, task.val_table)

Demos

List of working demos:

Name Description
rel-stackex exploring rel-stackex dataset and tasks
rel-amazon exploring rel-amazon dataset and tasks

Cite RelBench

If you use RelBench in your work, please cite our paper:

@article{relbench,
  title={Relational Deep Learning: Graph Representation Learning on Relational Tables},
  author={Matthias Fey, Weihua Hu, Kexin Huang, Jan Eric Lenssen, Rishabh Ranjan, Joshua Robinson, Rex Ying, Jiaxuan You, Jure Leskovec},
  year={2023}
}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

relbench-0.1.0.tar.gz (46.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

relbench-0.1.0-py3-none-any.whl (24.5 kB view details)

Uploaded Python 3

File details

Details for the file relbench-0.1.0.tar.gz.

File metadata

  • Download URL: relbench-0.1.0.tar.gz
  • Upload date:
  • Size: 46.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.27.1

File hashes

Hashes for relbench-0.1.0.tar.gz
Algorithm Hash digest
SHA256 1b7ba6ff4d67b0da2271b04367bbce3f1d30812033e1cd209accc941dac6eb6f
MD5 7f486c59837eaf95b9802a31618a7c23
BLAKE2b-256 d727c4ead81c60d5e24b639fdcd9011783d3621ffd68fcc69f0a0dfd113c274f

See more details on using hashes here.

File details

Details for the file relbench-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: relbench-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 24.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.27.1

File hashes

Hashes for relbench-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0003e2c5a4aebbc76dcf40c62b8a67c16629b66626075f2818dd2e2b618ad353
MD5 8e5c30630e328a5fc4007e36fe243cc7
BLAKE2b-256 1d3394da3e303c618f930d2114d02c681b1a86d02a6bdf0490980d6fe2dfedb4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page