Can the dataset of graph classification task be used for node classification training? #2650
Answered
by
rusty1s
jiaruHithub
asked this question in
Q&A
-
Dear developers: |
Beta Was this translation helpful? Give feedback.
Answered by
rusty1s
May 28, 2021
Replies: 1 comment 1 reply
-
A graph classification dataset contains only a single label per graph, while in node classification you have a label for each node. If you want to cast a graph classification dataset to a node classification one, I think it's reasonable to set each node label to the ground-truth label of the given class, e.g.: def transform(data):
data.y = data.y.repeat(data.num_nodes)
return data
dataset = TUDataset(..., transform=transform) |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
jiaruHithub
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
A graph classification dataset contains only a single label per graph, while in node classification you have a label for each node. If you want to cast a graph classification dataset to a node classification one, I think it's reasonable to set each node label to the ground-truth label of the given class, e.g.: