A feature is a measurable attribute or numerical representation used as model input. In ordinary datasets, features come from measurements such as precipitation, temperature range, and wind speed; in graph machine learning, they can be derived from nodes, relationships, or graph structure. section 10.0
Graph features are constructed through complementary approaches:
- Manual feature engineering uses domain knowledge and graph metrics, including node degree, clustering coefficients, centrality, and neighborhood statistics. These features are interpretable and validate easily, but they require design effort and may miss complex patterns. section 10.0 section 10.1
- Representation learning automatically converts graph structure and additional node information into dense vectors. It reduces manual intervention and can capture complex patterns, but the resulting features are harder to interpret. section 10.0 section 11.2.1
- Path-based features represent connectivity between node pairs. Metapath counts can be adjusted with degree-weighted path counts so highly connected intermediate nodes contribute less. section 10.2.2
Fraud detection features
A fraud classifier represents each network node with numerical indicators and a fraudster or legitimate label. Local features inspect one-hop or n-hop neighborhoods; global features measure network-wide roles through metrics such as betweenness centrality, closeness centrality, PageRank, and Eigenvector centrality. Shortest-path features can record distance and the number of paths to fraudulent nodes at one, two, or three hops. NetworkX code computes these metrics automatically, using Dijkstra’s algorithm for shortest paths. section 10.1 section 10.1.4
Drug-repurposing features
For a compound–disease pair such as metformin and type 2 diabetes, each selected metapath becomes a feature. Cypher queries calculate both path count and degree-weighted path count for paths such as compound–binds–gene–associates–disease and compound–binds–gene–participates–pathway–participates–gene–associates–disease. section 10.2.2
Figure 10.2 Node feature extraction: using metrics and graph algorithms to transform nodes into numerical feature vectors that capture key characteristics
Shows how graph metrics and algorithms transform nodes into numerical feature vectors. section 10.1













