Label Propagation on Cora
Author: K3-Node Team
Backend: Multi-Backend
Dataset: Cora (Planetoid)
Description: Classify papers in the Cora citation network by topic without training any model.
Label Propagation on Cora
Classify papers in the Cora citation network by topic without training any model. Label propagation (Zhu & Ghahramani, 2002) starts from the 140 known labels and repeatedly lets every paper take the average label of its neighbors, since linked papers tend to share a topic.
Same model as PyG's examples/label_prop.py; on Cora instead of ogbn-arxiv to keep the dataset small.
Install K3-Node, then choose a backend: "tensorflow", "torch" or "jax"
Load the data
data holds one graph: node features x, edges edge_index, labels y, and masks marking the training, validation and test nodes.
import keras
from keras import ops
from k3_node.datasets import Planetoid
from k3_node.loader import FullGraphDataset
from k3_node.models import LabelPropagation
dataset = Planetoid("data/Planetoid", name="Cora")
data = dataset[0]
print(data)