17.2 Using the Supervised GraphWise Algorithm (Vertex Embeddings and Classification)
Supervised GraphWise is an inductive vertex representation learning algorithm which is able to leverage vertex feature information. It can be applied to a wide variety of tasks, including vertex classification and link prediction.
Supervised GraphWise is based on GraphSAGE by Hamilton et al.
Model Structure
A Supervised GraphWise model consists of graph convolutional layers followed by several prediction layers.
The forward pass through a convolutional layer for a vertex proceeds as follows:
- A set of neighbors of the vertex is sampled.
- The previous layer representations of the neighbors are mean-aggregated, and the aggregated features are concatenated with the previous layer representation of the vertex.
- This concatenated vector is multiplied with weights, and a bias vector is added.
- The result is normalized to such that the layer output has unit norm.
The prediction layers are standard neural network layers.
The following describes a few use
cases where SupervisedGraphWise
algorithm can be applied:
- Node Classification in Citation Networks: To predict the category of a paper (such as biology, computer science, and so on) based on the papers it cites and its attributes. This can be useful for academic research tools and repositories that classify research papers for easier discovery.
- Customer Segmentation: To classify customers in a transaction network into different segments based on their purchasing behavior and relationships with other customers. This can be used for personalized marketing campaigns.
- Disease Prediction in Healthcare Networks: To predict the likelihood of disease spread or emergence of symptoms based on patient data and interactions within healthcare networks, such as hospitals or clinics.
The following describes the usage of the main functionalities of the implementation of GraphSAGE in PGX using the Cora graph as an example:
- Loading a Graph
- Building a Minimal GraphWise Model
- Advanced Hyperparameter Customization
- Building a GraphWise Model Using Partitioned Graphs
- Supported Property Types for Supervised GraphWise Model
- Classification Versus Regression Models on Supervised GraphWise Models
- Setting a Custom Loss Function and Batch Generator (for Anomaly Detection)
- Training a Supervised GraphWise Model
- Getting the Loss Value For a Supervised GraphWise Model
- Getting the Training Log for a Supervised GraphWise Model
- Inferring the Vertex Labels for a Supervised GraphWise Model
- Evaluating the Supervised GraphWise Model Performance
- Inferring Embeddings for a Supervised GraphWise Model
- Storing a Trained Supervised GraphWise Model
- Loading a Pre-Trained Supervised GraphWise Model
- Destroying a Supervised GraphWise Model
- Explaining a Prediction of a Supervised GraphWise Model
Parent topic: Using the Machine Learning Library (PgxML) for Graphs