Why is the tox21 dataset loaded with predefined 12 classes when it should be binary classification, thus two classes?

Code sampled modified:

import rdkit
from torch_geometric.datasets import MoleculeNet

# Load the Tox21 dataset
data = MoleculeNet(root=".", name="Tox21")
print("Dataset type: ", type(data))
print("Dataset features: ", data.num_features)
print("Dataset target: ", data.num_classes)
print("Dataset length: ", data.len)

> Dataset type:  <class 'torch_geometric.datasets.molecule_net.MoleculeNet'>
> Dataset features:  9
> Dataset target:  12

I'm borrowing code from this post.

There are 12 assays, so one could train and test by assay, in which case we would end up with a Toxic|non-toxic (two classes) for each assay.

How do I setup the data class to work by group (e.g., by assay)?


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.