get_gli_dataset
- gli.dataloading.get_gli_dataset(dataset: str, task: str, task_id: int = 1, device: str = 'cpu', verbose: bool = False) DGLDataset
Get a graph dataset given dataset name and task config.
- Parameters:
dataset (str) – graph dataset name.
task (str) – task type, e.g. “NodeClassification”, “NodeRegression”.
task_id (int, optional.) – task ID defined in dataset folder, defaults to 1.
device (str, optional) – device name, defaults to “cpu”.
verbose (bool, optional) – verbose level, defaults to False.
- Return type:
dgl.data.DGLDataset
.
This function essentially performs the following steps:
g = get_gli_graph(dataset, device=device, verbose=verbose) t = get_gli_task(dataset, task, task_id=task_id, verbose=verbose) return combine_graph_and_task(g, t)
Note
gli.dataloading.get_gli_dataset()
will download the data files if the data files do not exist in the local file system.Examples
>>> d = get_gli_dataset(dataset="cora", task="NodeClassification") >>> d.name 'CORA dataset. NodeClassification'