Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to split a heterogeneous graph for link_pred targeting specific edge_type? #37

Open
SohaK opened this issue Dec 21, 2021 · 2 comments

Comments

@SohaK
Copy link

SohaK commented Dec 21, 2021

Hi
I want to split a heterogeneous graph into train, dev, and test set for link_pred, but I need to have the positive and negative instances of the edges/links from a specific edge_type. Predicting that kind of edge is the problem description, other edges are just informative. Is there a way to do that with split?

Thanks,
Soha

@anniekmyatt
Copy link

anniekmyatt commented Dec 21, 2021

I might be wrong but I think deepsnap’s splitting functionality will give you positive and negative supervision edges for all edge types in a hetero graph. If you want to specify one edge type for your supervision edges maybe have a look at pytorch-geometric’s RandomLinkSplit, see for example how it’s used here. In the same folder there is also a hetero_link_pred example which I contributed, so I hope it doesn’t seem like showing off that I share it😅, it just seems fairly relevant to what you’re trying to do.

@SohaK
Copy link
Author

SohaK commented Dec 23, 2021

Thanks @anniekmyatt both RandomLinkSplit functionality and the code example are very useful for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants