liveBook · Manning

GraphSAGE

As explained in Knowledge Graphs and LLMs in Action

GraphSAGE is an inductive graph representation-learning framework that generates node representations by aggregating information from sampled neighborhoods.

GraphSAGE is a graph neural network encoder that generates node representations by aggregating neighborhood features. It supports downstream node classification and link prediction through an encoder–decoder pipeline. section 12.0

A practical GraphSAGE pipeline follows these steps:

  • Represent a domain as a graph, such as transactions connected by Bitcoin flows or users connected to movies through ratings. section 12.0
  • Apply two SAGEConv layers: transform input features, apply ReLU, and produce output node representations. section 12.1.4
  • Pass representations to a task-specific decoder, such as log_softmax with CrossEntropyLoss for node classification. section 12.1.4
  • Evaluate predictions with precision, recall, F1-score, and confusion matrices, while comparing parameter counts and training time. section 12.1.5 section 12.2.5

AML node classification

A two-layer SAGE encoder processes a homogeneous transaction graph and produces representations used to classify each transaction as licit or illicit. In the reported comparison, SAGE used 5,427 parameters and trained in 36.71 seconds after 400 epochs, between GCN and GAT in efficiency.

How Knowledge Graphs and LLMs in Action covers it

How deep it goes
Implements a two-layer encoder with feature transformation, ReLU, and neighborhood aggregation, without detailing SAGE's internal sampling procedure.
Examples
Uses transaction graphs for licit-versus-illicit classification and user–movie graphs for recommendation link prediction.
What it assumes
Assumes familiarity with homogeneous graphs, message passing, neural-network layers, and PyTorch-based model construction.
What you can do after
Builds a PyTorch Geometric SAGE encoder and applies it within classification or recommendation evaluation workflows.
How it connects
Connects GNN encoders with encoder–decoder architectures, node classification, link prediction, GCN, and GAT.

Also explained in

Compare how 2 books explain GraphSAGE →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Knowledge Graphs and LLMs in Action. The section links point to the parts of the book it draws on.