Link prediction
Link prediction is a graph-learning task that estimates whether a connection exists or may occur between nodes, often by scoring candidate links.
Knowledge Graphs and LLMs in Action
Link prediction is a graph-learning technique that forecasts missing, future, or otherwise unobserved connections between nodes, optionally assigning scores or probabilities to candidate links.
- How it is used
- Uses graph structure to forecast missing or future connections for recommendations, scientific discovery, security, and relational inference.
- How deep it goes
- Builds the task from graph representation through featurization, classifiers, GNN encoders, decoders, scoring, and evaluation.
- Examples
- Demonstrates co-authorship forecasting, drug repurposing, and MovieLens user–movie recommendation using structural features, Node2Vec, and heterogeneous GNNs.
- What you can do after
- Build it from scratch as a graph-learning pipeline that featurizes nodes or pairs, trains a scorer, predicts links, and evaluates results.
Read how Knowledge Graphs and LLMs in Action explains link prediction →
Graph Algorithms for Data Science
Link prediction is a graph machine learning task that predicts prospective relationships between nodes, optionally including their relationship types.
- How it is used
- Predicts future or missing relationships for network analysis and recommender systems.
- How deep it goes
- Walks through pair-feature construction, leakage-safe splitting, negative sampling, and binary-classifier training without optimization details.
- Examples
- Uses friendship pairs, user–product purchases, drug–disease links, and Twitch shared audiences.
- What you can do after
- Apply it via Cypher, pandas, and a classifier to train and evaluate relationship predictions from graph features.
Read how Graph Algorithms for Data Science explains link prediction →
Graph Neural Networks in Action
Link prediction, or edge prediction, is a graph-learning task that estimates whether an edge exists or should exist between graph entities.
- How it is used
- Predicts links between node pairs when graph relationships are missing, costly to observe, or changing.
- How deep it goes
- Builds a GCN-based encoder and decoder, then details edge splitting, training, and evaluation; defers the inner-product rationale.
- Examples
- Uses Amazon Electronics co-purchases to demonstrate edge exploration, a validation/test split, and held-out ROC AUC evaluation.
- What you can do after
- Apply it via PyTorch Geometric to prepare edges, train a graph autoencoder, and evaluate predicted links.
Read how Graph Neural Networks in Action explains link prediction →
Related concepts
- graph neural networkused by · A graph neural network is a neural-network model that learns representations or predictions from graph-structured data by combining information from connected entities.
- Adamic-Adar indexused by · The Adamic-Adar index is a link-prediction metric that scores node pairs by weighting common neighbors more highly when they have lower degree.
- recommender systemuses · A recommender system is software that predicts, selects, or ranks items, content, or actions for users based on available information about users, items, or context.
- semi-supervised learninguses · Semi-supervised learning is a machine-learning approach that trains models using both labeled and unlabeled data.
- graph autoencoderaddressed by · A graph autoencoder is a graph neural network encoder-decoder model that learns latent graph representations and reconstructs graph-related inputs or structure.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.


