ReDeLEx: A Framework for Relational Deep Learning Exploration
Project description
ReDeLEx
ReDeLEx (Relational Deep Learning Exploration) is a Python framework for the development and evaluation of Relational Deep Learning (RDL) models. It enables end-to-end experimentation with graph-based neural networks on relational databases (RDBs), building on the CTU Relational Learning Repository and fully integrating with the RelBench interface.
It provides tools to transform SQL databases into heterogeneous graph representations suitable for Graph Neural Networks (GNNs), supports both static and temporal tasks, and enables a structured comparison across classical and deep learning models.
🧠 Features
- ✅ Supports direct SQL database connectivity (local or remote RDBMS)
- 🔗 Transforms relational schemas into heterogeneous graphs
- 🧩 Automates attribute type inference and encoding (categorical, numerical, text, time)
- 📦 Provides access to 70+ relational datasets from the CTU Repository
- 🧪 Supports benchmarking tasks including binary/multiclass classification, temporal tasks, and pretraining
- 🧠 Compatible with diverse neural architectures (e.g., GraphSAGE, Transformer-based models)
- 📊 Evaluates classical ML models (e.g., LightGBM, Propositionalization) alongside RDL models
📦 Installation
Install ReDeLEx via pip:
pip install redelex
If you're using RelBench, the CTU datasets are automatically supported.
🚀 Quickstart
Loading CTU datasets
Using RelBench interface:
from relbench.datasets import get_dataset
import redelex
dataset = get_dataset('ctu-seznam')
db = dataset.get_db()
Using ReDeLEx directly:
from redelex import datasets as ctu_datasets
dataset = ctu_datasets.Seznam()
db = dataset.get_db()
Loading a custom SQL database
from redelex.datasets import DBDataset
custom_dataset = DBDataset(
dialect="mariadb", # e.g. postgresql, sqlite, mysql
driver="mysqlconnector",
user="your_user",
password="your_password",
host="your_host",
port=3306,
database="your_database"
)
db = custom_dataset.get_db(upto_test_timestamp=False)
Note: For full examples of task and schema configuration, see examples in ctu_datasets.py.
📚 Tasks & Use Cases
ReDeLEx supports:
- Node-level prediction (static or temporal)
- Link prediction
- Pretraining tasks via value masking
- Database modification for complex task generation
Each task is backed by a training table and optionally a temporal schema.
🏗️ Architecture
RDL models in ReDeLEx are modular and consist of:
- Attribute encoders for tabular data
- Tabular models (optional, e.g. ResNet)
- Graph Neural Network layers
- Task-specific heads (e.g. MLP classifiers)
Supported model examples include:
- Linear SAGE
- Tabular ResNet + GraphSAGE
- DBFormer (Transformer-based)
📈 Experiments
ReDeLEx includes tools for:
- Selecting RDL-suitable datasets based on structure and size
- Comparing RDL with traditional ML and propositionalization
- Benchmarking across 70+ relational datasets from various domains
For experimental results and performance benchmarks, see the ECML PKDD 2025 paper (coming soon).
⚙️ Development
Install uv (recommended for managing environments)
- macOS & Linux
wget -qO- https://astral.sh/uv/install.sh | sh
- Windows
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
More info: https://docs.astral.sh/uv/getting-started/installation/
Install dependencies
CPU:
uv sync
uv pip install pyg_lib torch_scatter torch_sparse torch_cluster torch_spline_conv -f https://data.pyg.org/whl/torch-2.4.0+cpu.html
CUDA 12.8:
uv sync --no-group cpu --group cu128
uv pip install pyg_lib torch_scatter torch_sparse torch_cluster torch_spline_conv -f https://data.pyg.org/whl/torch-2.8.0+cu128.html
CUDA 12.4 (Old CUDA env):
uv sync --no-group cpu --group cu124
uv pip install pyg_lib torch_scatter torch_sparse torch_cluster torch_spline_conv -f https://data.pyg.org/whl/torch-2.4.0+cu124.html
CUDA 12.1 (RCI Setup):
uv sync --no-group cpu --group cu121
uv pip install pyg_lib==0.3.1 torch_scatter torch_sparse torch_cluster torch_spline_conv -f https://data.pyg.org/whl/torch-2.1.2+cu121.html
Enable and run pre-commit
uv run pre-commit install
uv run pre-commit run
Database schema visualizations
Visualizations run on Graphviz, which needs to be available on your system.
- Install
Graphvizhttps://graphviz.org/download/
📜 Citation
If you use ReDeLEx in your work, please cite:
@misc{peleska2025redelex,
title={REDELEX: A Framework for Relational Deep Learning Exploration},
author={Jakub Peleška and Gustav Šír},
year={2025},
eprint={2506.22199},
archivePrefix={arXiv},
primaryClass={cs.LG},
url={https://arxiv.org/abs/2506.22199},
}
📎 Acknowledgements
This project has received funding from the European Union’s Horizon Europe program under the grant agreement TUPLES No. 101070149, and the Czech Science Foundation grant No. 24-11664S.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file redelex-0.6.2.tar.gz.
File metadata
- Download URL: redelex-0.6.2.tar.gz
- Upload date:
- Size: 66.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a2c1309e0bdd039b1278ebc9a2222b9dfb6fcb89bcc6cdecf623e6e25586283c
|
|
| MD5 |
7bbf75c01369b06eae612f7bd2514e88
|
|
| BLAKE2b-256 |
8774f02d5e407ce4e9fbd04afd40840f62498e0c3361f0cee5d919a3aa49dc79
|
Provenance
The following attestation bundles were made for redelex-0.6.2.tar.gz:
Publisher:
publish-to-pypi.yml on jakubpeleska/redelex
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
redelex-0.6.2.tar.gz -
Subject digest:
a2c1309e0bdd039b1278ebc9a2222b9dfb6fcb89bcc6cdecf623e6e25586283c - Sigstore transparency entry: 1188970965
- Sigstore integration time:
-
Permalink:
jakubpeleska/redelex@17b4cf05e13040a3c140de881a503e821c0df881 -
Branch / Tag:
refs/tags/v0.6.2 - Owner: https://github.com/jakubpeleska
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@17b4cf05e13040a3c140de881a503e821c0df881 -
Trigger Event:
push
-
Statement type:
File details
Details for the file redelex-0.6.2-py3-none-any.whl.
File metadata
- Download URL: redelex-0.6.2-py3-none-any.whl
- Upload date:
- Size: 86.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6b60d9a8bbe455992e8f4bde52bd8208e6f9d7d22e2b58950c968e7d264accf4
|
|
| MD5 |
4113ef9414bd3bbc97c86e3deadaffa6
|
|
| BLAKE2b-256 |
dd4faaf23ccfc045991c5b9499d4385254dc248c53f6a99856a34b95bd0db5b5
|
Provenance
The following attestation bundles were made for redelex-0.6.2-py3-none-any.whl:
Publisher:
publish-to-pypi.yml on jakubpeleska/redelex
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
redelex-0.6.2-py3-none-any.whl -
Subject digest:
6b60d9a8bbe455992e8f4bde52bd8208e6f9d7d22e2b58950c968e7d264accf4 - Sigstore transparency entry: 1188970968
- Sigstore integration time:
-
Permalink:
jakubpeleska/redelex@17b4cf05e13040a3c140de881a503e821c0df881 -
Branch / Tag:
refs/tags/v0.6.2 - Owner: https://github.com/jakubpeleska
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@17b4cf05e13040a3c140de881a503e821c0df881 -
Trigger Event:
push
-
Statement type: