Skip to main content

ReDeLEx: A Framework for Relational Deep Learning Exploration

Project description

ReDeLEx

website PyPI version License: MIT

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.

Published at ECML PKDD 2025, ReDeLEx is the first unified platform to bridge classical propositionalization-based relational learning and modern graph-based deep learning methods. 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:

  1. Attribute encoders for tabular data
  2. Tabular models (optional, e.g. ResNet)
  3. Graph Neural Network layers
  4. 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.4:

uv sync --no-group cpu --group cu124

Enable and run pre-commit

uv run pre-commit install
uv run pre-commit run

📜 Citation

If you use ReDeLEx in your work, please cite:

📎 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.


🔍 For full dataset explorer, visit: https://relational.fel.cvut.cz

📂 Source code and issue tracking: https://github.com/jakubpeleska/ReDeLEx

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

redelex-0.5.0.tar.gz (52.9 kB view details)

Uploaded Source

Built Distribution

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

redelex-0.5.0-py3-none-any.whl (63.2 kB view details)

Uploaded Python 3

File details

Details for the file redelex-0.5.0.tar.gz.

File metadata

  • Download URL: redelex-0.5.0.tar.gz
  • Upload date:
  • Size: 52.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for redelex-0.5.0.tar.gz
Algorithm Hash digest
SHA256 d988eac4e721fdac91246a0d597eedace5f6cc65c28205607804e1b9bcb84021
MD5 fba4787efddb5f83378583d6df3c1255
BLAKE2b-256 00e7241895f16f2811343a6b716f424d2604ee09b004d672b61c2b38a63dcaf4

See more details on using hashes here.

Provenance

The following attestation bundles were made for redelex-0.5.0.tar.gz:

Publisher: publish-to-pypi.yml on jakubpeleska/ReDeLEx

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file redelex-0.5.0-py3-none-any.whl.

File metadata

  • Download URL: redelex-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 63.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for redelex-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 cb3a59814001825b9e498e97b28e6d9a3a3a5ffab277f350938ef7493cb876b2
MD5 517325e17f885c82ea0eaabf3feace1a
BLAKE2b-256 57f0307ee34bcaa8e04ed760f177f8836c31b1d9b6d4b3d8897ecef69b265382

See more details on using hashes here.

Provenance

The following attestation bundles were made for redelex-0.5.0-py3-none-any.whl:

Publisher: publish-to-pypi.yml on jakubpeleska/ReDeLEx

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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