-
Notifications
You must be signed in to change notification settings - Fork 3k
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
The dgl.data.TUDataset class returns labels in {0,2} for some binary classes. Can we instead return {0, 1}? #2165
Comments
hi, HenryKenlay: Lines 320 to 330 in b10b541
|
henrykenlay
added a commit
to henrykenlay/dgl
that referenced
this issue
Sep 10, 2020
henrykenlay
added a commit
to henrykenlay/dgl
that referenced
this issue
Sep 10, 2020
6 tasks
Closed
Fixed in #2173 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
🚀 Feature
The graph class labels returned by some binary TUDatasets are {0, 2} (such as
dgl.data.TUDataset('BZR')
. Some datasets are {0, 1} such asdgl.data.TUDataset('MCF-7')
. It would be good if this behaviour was more consistent.Motivation
By having consistent behaviour users wouldn't have to wrap the class in a preprocessing layer to make sure the labels are consistent with standard conventions (such as a model using a logistic activation function for binary prediction models with binary cross-entropy loss).
I did notice that in the notes section of the docs it reads
However, this isn't actually the case since the raw BZR graph labels are {-1, 1}, the labels are preprocessed by adding the minimum label to all labels.
Alternatives
Do not modify the graph labels at all, as per the docs.
Pitch
Preprocessing the labels so that the labels are
{0, ..., n-1}
wheren
is the number of classes would be the easiest for the user. An additional argument could be added which allows the user to access theraw
labels if needed.Additional context
I can put in a pull request if this change seems reasonable.
The text was updated successfully, but these errors were encountered: