Link prediction¶
StellarGraph provides numerous algorithms for doing link prediction on graphs. This folder contains demos of all of them to explain how they work and how to use them as part of a TensorFlow Keras data science workflow.
A link prediction task predicts an attribute of links/edges in a graph. For instance, predicting whether a link/edge that isn’t already in the graph should exist (binary classification, or recommendation, or knowledge base completion, in a knowledge graph), or even labelling existing links with a categorical class (binary classification or multiclass classification), or predicting a continuous number (regression). It is supervised or semi-supervised, where the model is trained using a subset of links/edges that have ground-truth labels. For predicting edge existence, the ground-truth may just be whether the edge exists in the original data, rather than a separate label.
Link prediction can also be done as a downstream task from node representation learning/embeddings, by combining node embedding vectors for the source and target nodes of the edge and training a supervised or semi-supervised classifier against the result. Unsupervised algorithms that can be used in this manner include random walk-based methods like Metapath2Vec. StellarGraph provides demos of unsupervised algorithms.
Find algorithms and demos for a graph¶
This table lists all node classification demos, including the algorithms trained and the types of graph used.
Demo |
Algorithm |
Node features |
Heterogeneous |
Temporal |
---|---|---|---|---|
GCN |
yes |
|||
Attri2Vec |
yes |
|||
GraphSAGE |
yes |
|||
HinSAGE |
yes |
yes |
||
Node2Vec |
||||
Metapath2Vec |
yes |
|||
CTDNE |
yes |
|||
ComplEx |
yes, multiple edge types |
|||
DistMult |
yes, multiple edge types |
See the root README or each algorithm’s documentation for the relevant citation(s). See the demo index for more tasks, and a summary of each algorithm.
Table of contents¶
- Link prediction via inductive node representations with attri2vec
- Knowledge graph link prediction with ComplEx
- Link prediction with Continuous-Time Dynamic Network Embeddings (CTDNE)
- Knowledge graph link prediction with DistMult
- Link prediction with GCN
- Link prediction with GraphSAGE
- Link prediction with Heterogeneous GraphSAGE (HinSAGE)
- Comparison of link prediction with random walks based node embedding
- Link prediction with Metapath2Vec
- Link prediction with Node2Vec