Skip to main content

A small library for loading and downloading relational datasets

Project description

relational-datasets

A small library for loading and downloading relational datasets.

Use Case 1: Managing Zipfiles of Data

Running the fetch method downloads a version of a datset to your local cache:

import relational_datasets

relational_datasets.fetch("toy_cancer")
relational_datasets.fetch("toy_father", "v0.0.2")
relational_datasets.fetch("webkb")

Resulting in:

~/relational_datasets/
├── toy_cancer_v0.0.3.zip   <--- latest
├── toy_father_v0.0.2.zip   <--- specific version
└── webkb_v0.0.3.zip        <--- latest

Use Case 2: Loading Data

The load method returns train and test folds—each with pos, neg, and facts.

For example: "Load fold-2 of webkb"

from relational_datsets import load

train, test = load("webkb", fold=2)

print(len(train.facts))
# 1344 facts in fold-2 of webkb

Install

From PyPi

pip install relational-datasets

From GitHub Source

git clone git@github.com:hayesall/relational-datasets.git
cd relational-datasets
pip install -e .

Function Signatures: Quick Reference

Load or fetch data:

load(name: str, version: str = "", fold: int = 1) -> Tuple[RelationalDataset, RelationalDataset]
fetch(name: str, version: str = "") -> str

Get or clear the cache directory:

get_data_home(data_home=None) -> str
clear_data_home(data_home=None) -> None

Helper method to check the latest version of datasets on GitHub:

latest_version() -> str

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

relational-datasets-0.1.0.tar.gz (9.1 kB view hashes)

Uploaded Source

Built Distribution

relational_datasets-0.1.0-py3-none-any.whl (10.4 kB view hashes)

Uploaded Python 3

Supported by

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