Betweenness centrality measures how often a node lies on shortest paths between source and destination nodes. Nodes appearing on many shortest paths have high centrality and may be influential; nodes appearing rarely have low centrality. section 8.3.4
Use betweenness centrality as engineered node data through this workflow:
- Start with an ETL output such as an edge list. section 8.3.4
- Import the graph into a graph-processing framework and calculate the value for every node. section 8.3.4
- Store values in a dictionary keyed by node ID, then attach them as node features for downstream machine learning. section 8.3.4
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.
Place centrality computation within the broader path from raw files to data instances consumed by PyTorch Geometric. section 8.3.4


