Skip to content

Reddit2

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

Bases: _GraphSAINTDataset

The Reddit dataset from the "GraphSAINT: Graph Sampling Based Inductive Learning Method" paper, containing Reddit posts belonging to different communities.

This is a sparser version of Reddit (~23M edges instead of ~114M), used in papers such as SGC and GraphSAINT. Nodes missing from the label file have the label -1.

This dataset follows the implementation of PyG (same files, edges and splits).

#nodes #edges #features #classes
232,965 23,213,838 602 41

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
Source code in mlx_graphs/datasets/large_graph.py
def __init__(
    self,
    base_dir: Optional[str] = None,
    pre_transform: Optional[Callable] = None,
    transform: Optional[Callable] = None,
):
    super().__init__("reddit2", base_dir, pre_transform, transform)

from mlx_graphs.datasets import Reddit2 · mlx_graphs/datasets/large_graph.py