-
Hello PyTorch Geometric community, I'm currently tackling a heterogeneous link prediction problem and would appreciate some guidance on aligning edge labels with specific edge types. In my dataset, I have two sets of known edge types: positive and negative. The structured representation of my data is in the form of a heterogeneous graph with edge types such as I am aiming to perform link prediction like the example provided here. For each specified edge type, I have a distinct edge index dictionary. My challenge lies in ensuring that the edge labels generated by RandomLinkSplit align correctly with the edge indices I've calculated for each edge type. Specifically, I want edges with the 'pos' edge type to have labels set to 1 and edges with the 'neg' edge type to have labels set to 0. If anyone in the community has insights, advice, or can assist in addressing this challenge, I would greatly appreciate it. Thank you in advance for your time and support! Best regards, |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Fixed it! By using |
Beta Was this translation helpful? Give feedback.
-
Here you have multi edges (two) per pair of cell type, ea. with pos or neg labels. is that in by design? |
Beta Was this translation helpful? Give feedback.
Fixed it! By using
key
in RandomLinkSplit, you can point to a self defined attribute. In this case, given I have N indices, I simply labeled them 1 or 0 in a separate variable and passed this to thekey
parameter in RandomLinkSplit.