Skip to content

jakubpeleska/ctu-relational-py

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CTU Relational

website PyPI version License: MIT

The CTU Prague Relational Learning Repository was originally published in 2015 with a goal to support machine learning research with multi-relational data. Today, the repository is hosted on https://relational.fel.cvut.cz and contains more than 80 different datasets stored in SQL databases.

The RelBench project is currently seeking a similar goal of establishing the Relational Deep Learning as a new subfield of deep learning. The goal of this library is to support the effort of RelBench team by providing the CTU Relational datasets in the standardized representation. As such, the library is an extension of the RelBench package.

Installation

You can install CTU Relational package through pip:

pip install ctu-relational

Contents

⚠️ The package is currenly in the development and contain only a subset of all available datasets. Rest will be added in the near future together with asociated tasks.

You can load datasets in same way as in the RelBench, e.g.:

from relbench.datasets import get_dataset
import ctu_relational

dataset = get_dataset('ctu-seznam') # automatically cached through the relbench package
db = dataset.get_db()

or directly from CTU Relational:

from ctu_relational import datasets as ctu_datasets

dataset = ctu_datasets.Seznam() # custom cache directory should be specified
db = dataset.get_db()

As opposed to the RelBench package, CTU Relational works directly with relational databases through the SQLAlchemy package. DBDataset class provides a way of loading an SQL database in the RelBench format. You can load data from your SQL server with the following snippet.

from ctu_relational.datasets import DBDataset

custom_dataset = DBDataset(
            dialect="mariadb", # other dialects should be supported but weren't tested
            driver="mysqlconnector",
            user=<user>,
            password=<password>,
            host=<host_url>,
            port=3306,
            database=<database_name>
        )

db = custom_dataset.get_db(upto_test_timestamp=False)

Although, directly loaded databases usually need some additional touches. Take a look at ctu_datasets.py for examples.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages