PlanetoidDataset
¶
PlanetoidDataset(
name: PLANETOID_NAMES,
split: PLANETOID_SPLITS = "public",
without_self_loops: bool = True,
base_dir: Optional[str] = None,
)
Bases: Dataset
The citation network datasets "Cora", "CiteSeer" and
"PubMed" from the "Revisiting Semi-Supervised Learning with Graph Embeddings" paper.
Nodes represent documents and edges represent citation links.
Training, validation and test splits are given by binary masks.
This dataset follows a similar implementation as in PyG.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
PLANETOID_NAMES
|
The name of the dataset ( |
required |
split
|
str
|
The type of dataset split ( |
'public'
|
without_self_loops
|
bool
|
Whether to remove self loops. Default to |
True
|
base_dir
|
Optional[str]
|
Directory where to store dataset files. Default is
in the local directory |
None
|
Example:
from mlx_graphs.datasets import Planetoid
dataset = Planetoid("cora")
>>> cora(num_graphs=1)
dataset[0]
>>> GraphData(
edge_index(shape=(2, 10556), int32)
node_features(shape=(2708, 1433), float32)
node_labels(shape=(2708,), int32)
train_mask(shape=(2708,), bool)
val_mask(shape=(2708,), bool)
test_mask(shape=(2708,), bool))
Source code in mlx_graphs/datasets/planetoid.py
from mlx_graphs.datasets import PlanetoidDataset · mlx_graphs/datasets/planetoid.py