A dataset split partitions labeled data into subsets used for fitting and evaluating a model. In graph machine learning, preprocessing commonly creates training, validation, and test sets before model training and inference. section 1.5.1 section 4.3.2
A practical graph-modeling workflow is:
- Create the split and retain the resulting sample or node indices. section 4.3.2
- Convert graph data into PyTorch Geometric tensors or a data object. section 4.3.2
- Apply the same indices to the converted graph data, preserving correspondence between features, labels, and nodes. section 4.3.2
- Use the training subset for loss calculation while passing the full graph through a GNN when message passing requires its relationships. section 4.3.2
A 20% test split
Set split = 0.2, generate indices for all samples, and call train_test_split with stratify=labels, test_size=split, and random_state=99. Convert the graph with NetworkX and from_networkx, then assign the retained indices to the PyG data object. section 4.3.2
Figure 1.14 Mental model of the GNN project. We start with raw data, which is transformed into a graph data model that can be stored in a graph database or used in a graph processing system. From the graph processing system (and some graph databases), exploratory data analysis and visualization can be done. Finally, for graph machine learning, data is preprocessed into a form that can be submitted for training.
Trace where dataset splitting fits: raw data becomes a graph, preprocessing prepares it for training and inference, and the resulting data feeds graph machine-learning models. section 1.5.1




















