In [ ]:
Copied!
!pip install relational-datasets
!pip install relational-datasets
fetch()¶
fetch() always returns the path to a specific version of a dataset.
If the dataset is not available in the cache, it is downloaded from the srlearn/datasets GitHub repository.
In [1]:
Copied!
from relational_datasets import fetch
fetch('toy_cancer', 'v0.0.5')
from relational_datasets import fetch
fetch('toy_cancer', 'v0.0.5')
Out[1]:
'/Users/hayesall/relational_datasets/toy_cancer_v0.0.5.zip'
load()¶
This function uses fetch() internally, so if a dataset is unavailable it is downloaded.
load() returns train and test folds in the form two namedtuples with pos, neg, and facts keys:
RelationalDataset = namedtuple("RelationalDataset", ['pos', 'neg', 'facts'])
In [2]:
Copied!
from relational_datasets import load
train, test = load('toy_cancer', 'v0.0.5')
train.pos
from relational_datasets import load
train, test = load('toy_cancer', 'v0.0.5')
train.pos
Out[2]:
['cancer(alice).', 'cancer(bob).', 'cancer(chuck).', 'cancer(fred).']
Last update:
June 20, 2022