How to get the result after doing link prediction

Hi everyone,
I am confused how can I read the link prediction result after I trained the model
Let say I ran the code posted on
https://docs.dgl.ai/en/0.8.x/tutorials/blitz/4_link_predict.html
And I got pos_score as the pred outcome
but how can I know which edge is predicted to exist (like node a to node b) ?
I saw previously someone said we can use pos_score.view(num_node,num_node) to get a adj matrix but it raised error as the torch size of pos_score is not fit the shape
error message: shape ‘[2708, 2708]’ is invalid for input of size 1055
Thx

The task of link prediction requires predicting missing edges. After training, you have a model for scoring arbitrary pairs of nodes. A naive approach is then scoring all node pairs that do not form an existing edge in the graph and treating the node pairs with a score higher than a pre-specified threshold as predicted edges.

pos_score.view(num_node,num_node) will not work for the tutorial as it consists of scores for the existing edges.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.