WikipediaNetwork
¶
WikipediaNetwork(
name: WIKIPEDIA_NETWORK_NAMES,
base_dir: Optional[str] = None,
pre_transform: Optional[Callable] = None,
transform: Optional[Callable] = None,
)
Bases: _GeomGCNDataset
The Wikipedia networks introduced in the "Multi-scale Attributed Node Embedding" paper, as pre-processed in the "Geom-GCN: Geometric Graph Convolutional Networks" paper.
Nodes represent web pages and edges represent hyperlinks between them. Node features represent several informative nouns in the Wikipedia pages. The task is to classify the nodes into one of five categories according to their average monthly traffic. The graphs are directed and heterophilous.
The 10 fixed train/validation/test splits (60%/20%/20%) of the Geom-GCN
paper are stored as masks of shape [num_nodes, 10] in the
train_mask, val_mask and test_mask attributes.
This dataset follows the implementation of PyG
with geom_gcn_preprocess=True. The raw (regression) versions of the
graphs, including "crocodile", are not available: PyG downloads them
from a host that is no longer reachable.
| Name | #nodes | #edges | #features | #classes |
|---|---|---|---|---|
| chameleon | 2,277 | 36,101 | 2,325 | 5 |
| squirrel | 5,201 | 217,073 | 2,089 | 5 |
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
WIKIPEDIA_NETWORK_NAMES
|
The name of the dataset ( |
required |
base_dir
|
Optional[str]
|
Directory where to store dataset files. Default is
in the local directory |
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 WikipediaNetwork
dataset = WikipediaNetwork("chameleon")
>>> chameleon(num_graphs=1)
dataset[0]
>>> GraphData(
edge_index(shape=(2, 36101), int32)
node_features(shape=(2277, 2325), float32)
node_labels(shape=(2277,), int32)
train_mask(shape=(2277, 10), bool)
val_mask(shape=(2277, 10), bool)
test_mask(shape=(2277, 10), bool))
References
Source code in mlx_graphs/datasets/geom_gcn.py
from mlx_graphs.datasets import WikipediaNetwork · mlx_graphs/datasets/geom_gcn.py