Skip to content

CoraFull

CoraFull(
    base_dir: Optional[str] = None,
    pre_transform: Optional[Callable] = None,
    transform: Optional[Callable] = None,
)

Bases: CitationFull

Alias for CitationFull with name="cora": the full Cora citation graph with 19,793 nodes, 126,842 edges, 8,710 features and 70 classes.

Parameters:

Name Type Description Default
base_dir Optional[str]

Directory where to store dataset files. Default is in the local directory .mlx_graphs_data/.

None
pre_transform Optional[Callable]

A function/transform applied to the graph once, before it is saved.

None
transform Optional[Callable]

A function/transform applied to the graph at every access.

None

Example:

from mlx_graphs.datasets import CoraFull

dataset = CoraFull()
>>> cora_full(num_graphs=1)

dataset[0]
>>> GraphData(
        edge_index(shape=(2, 126842), int32)
        node_features(shape=(19793, 8710), float32)
        node_labels(shape=(19793,), int32))
Source code in mlx_graphs/datasets/citation_full.py
def __init__(
    self,
    base_dir: Optional[str] = None,
    pre_transform: Optional[Callable] = None,
    transform: Optional[Callable] = None,
):
    super().__init__(
        "cora",
        base_dir=base_dir,
        pre_transform=pre_transform,
        transform=transform,
    )

from mlx_graphs.datasets import CoraFull · mlx_graphs/datasets/citation_full.py