Created
May 17, 2021 20:56
-
-
Save sidneyarcidiacono/920aa0c6f3a9b5bc26d5e48886a6785c to your computer and use it in GitHub Desktop.
Train/test split with pytorch-geometric
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Now, we need to perform our train/test split. | |
# We create a seed, and then shuffle our data | |
torch.manual_seed(12345) | |
dataset = dataset.shuffle() | |
# Once it's shuffled, we slice the data to split | |
train_dataset = dataset[150:-150] | |
test_dataset = dataset[0:150] | |
# Take a look at the training versus test graphs | |
print(f'Number of training graphs: {len(train_dataset)}') | |
print(f'Number of test graphs: {len(test_dataset)}') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment