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 →
What to know first
- graphA graph is a mathematical structure consisting of vertices and edges that connect pairs of vertices to represent relationships or connections.
- recommender systemA recommender system is a computational system that predicts, selects, or ranks items, content, or actions for users based on available information.
- embeddingAn embedding is a numerical vector representation of an item in a feature space, encoding selected properties or relationships for computational tasks such as comparison or retrieval.
- deep learningDeep learning is a machine-learning approach that uses neural networks with multiple computational layers to learn representations from data.
Related concepts
- 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.
- 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.
- recommender systemuses · A recommender system is a computational system that predicts, selects, or ranks items, content, or actions for users based on available information.
- common neighbor countused by · Common neighbor count is the number of nodes directly connected to both members of a node pair, often used as a link-prediction score.
- 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.
- link prediction featureuses · A link prediction feature is an input variable that represents similarity, distance, or structural evidence for a prospective relationship between two nodes.
Questions about link prediction
What is 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.
Which Manning books explain link prediction?
Knowledge Graphs and LLMs in Action, Graph Algorithms for Data Science and Graph Neural Networks in Action.
What should I know before learning link prediction?
Manning books that teach link prediction usually introduce graph, recommender system, embedding and deep learning first.
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.


