Skip to content
Discussion options

You must be logged in to vote
train_mask = torch.rand(data.num_nodes) < 0.5
test_mask = ~train_mask

train_data = copy.copy(data)
train_data.edge_index, _ = subgraph(train_mask, data.edge_index, relabel_nodes=True)
train_data.x = data.x[train_mask]

test_data = copy.copy(data)
test_data.edge_index, _ = subgraph(test_mask, data.edge_index, relabel_nodes=True)
test_data.x = data.x[test_mask]

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@scottshufe
Comment options

Comment options

You must be logged in to vote
1 reply
@scottshufe
Comment options

Answer selected by scottshufe
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants