Use a PyTorch Geometric Dataset to turn raw graph files into repeatable data objects that support preprocessing, splitting, batching, and model ingestion. The Dataset and InMemoryDataset classes organize this pipeline, while Data represents each graph. section 8.3.4
Custom social-network dataset
A process() implementation reads an edge list with NetworkX, maps named nodes to integer indices, constructs edge_index, x, y, and masks, wraps them in Data, and collates the result.
Figure 8.15 Steps to preprocess data in PyG. From raw files, there are essentially two paths to prep data for ingestion by a PyG algorithm. The first path, shown here, directly creates an iterator of data instances, which is used by the dataloader. The second path mimics the first but performs this process within the dataloader class.
Use the preprocessing figure to compare direct iteration from raw files with preprocessing performed within a dataloader. section 8.3.4
