request.load
¶
Request copies of relational datasets.
load(name, version=None, *, fold=1)
¶
Get train/test instances of a dataset
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name |
str
|
Dataset name (e.g. |
required |
version |
Optional[str]
|
Dataset version (e.g. |
None
|
fold |
int
|
In datasets with multiple folds, return this fold. This value is ignored if the data is not split into multiple folds. |
1
|
Returns:
Type | Description |
---|---|
Tuple[RelationalDataset, RelationalDataset]
|
Returns the training and test. |
Raises:
Type | Description |
---|---|
urllib.error.URLError
|
If the data is not in the cache and cannot be downloaded, a failed request will raise this exception. |
Examples:
Load version v0.0.3
of the toy_cancer
dataset:
>>> from relational_datasets import load
>>> train, test = load("toy_cancer", "v0.0.3")
>>> train.pos
['cancer(alice).', 'cancer(bob).', 'cancer(chuck).', 'cancer(fred).']
Source code in relational_datasets/request.py
214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 |
|
Last update:
June 20, 2022