Reputation: 31
I have a custom homogeneous graph dataset with undirected edges, where each edge has 22 features and each node has 2 features. I would like to perform link prediction on this dataset using the edge features. I attempted to do so using a PyTorch geometric example, which demonstrates link prediction based on node features.
How can I use edge features for link prediction instead of node features, as shown in the example?
A similar question has been asked before, but it didn't receive much attention.
Upvotes: 3
Views: 303
Reputation: 52
Usually, link prediction algorithms that leverages node features to perform link prediction, combines them in order to obtain an edge representation.
For example, combining the features of nodes a and b, we will get the (a, b) edge representation... At this point we can use something like a linear layer to transform this representation into a score s((a, b)) that describes the likelihood of the edge to appear in the graph.
For your specific case, you can proceed in two ways:
However, the training of a network for a link prediction task usually requires the use of negative edges (connection that are less likely to appear in the network), and in your case, for a fair training, you should be able to compute edge features also for negative edges.
Upvotes: 0