Skip to content
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

[Feature] Adjusted homophily and label informativeness #6516

Merged

Conversation

OlegPlatonov
Copy link
Contributor

Description

Hi! In a recent paper Characterizing Graph Datasets for Node Classification: Homophily-Heterophily Dichotomy and Beyond several characteristics of labeled graphs have been proposed. First, it has been shown that a rarely used in graph ML literature measure named adjusted homophily satisfies more desirable properties than other homophily measures, which makes it appropriate for comparing homophily levels across datasets with different number of classes, class sizes, and degree distributions across classes. Further, a new characteristic - label informativeness - has been proposed. It shows how much information about a node's label we get from knowing its neighbor's label. It has been shown that label informativeness is much more correlated with GNN performance than homophily.

In this PR I've added adjusted homophily and label informativeness to DGL.

Checklist

Please feel free to remove inapplicable items for your PR.

  • The PR title starts with [$CATEGORY] (such as [NN], [Model], [Doc], [Feature]])
  • I've leverage the tools to beautify the python and c++ code.
  • The PR is complete and small, read the Google eng practice (CL equals to PR) to understand more about small PR. In DGL, we consider PRs with less than 200 lines of core code change are small (example, test and documentation could be exempted).
  • All changes have test coverage
  • Code is well-documented
  • To the best of my knowledge, examples are either not affected by this change, or have been fixed to be compatible with this change
  • Related issue is referred in this PR
  • If the PR is for a new model/paper, I've updated the example index here.

Changes

  • Added adjusted homophily and tests for it.
  • Added edge label informativeness and node label informativeness and tests for them.

@dgl-bot
Copy link
Collaborator

dgl-bot commented Nov 1, 2023

Not authorized to trigger CI. Please ask core developer to help trigger via issuing comment:

  • @dgl-bot

@dgl-bot
Copy link
Collaborator

dgl-bot commented Nov 1, 2023

Commit ID: cc7ce6593f897abf364a3f4c57ce4685d7b1de29

Build ID: 1

Status: ❌ CI test failed in Stage [Authentication].

Report path: link

Full logs path: link

@frozenbugs
Copy link
Collaborator

@dgl-bot

@dgl-bot
Copy link
Collaborator

dgl-bot commented Nov 2, 2023

Commit ID: 6c8a959d5bd6152a2453903d05c8ad58df545865

Build ID: 2

Status: ✅ CI test succeeded.

Report path: link

Full logs path: link

Copy link
Collaborator

@rudongyu rudongyu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution! I left a few comments, mainly on the documentation and the coding of loops over nodes and edges. Besides, you can add index to these measures here: https://github.com/dmlc/dgl/blob/master/docs/source/api/python/dgl.rst?plain=1#L207.

python/dgl/homophily.py Show resolved Hide resolved
python/dgl/homophily.py Outdated Show resolved Hide resolved
python/dgl/homophily.py Outdated Show resolved Hide resolved
python/dgl/homophily.py Outdated Show resolved Hide resolved
python/dgl/label_informativeness.py Outdated Show resolved Hide resolved
python/dgl/label_informativeness.py Outdated Show resolved Hide resolved
python/dgl/label_informativeness.py Outdated Show resolved Hide resolved
python/dgl/label_informativeness.py Outdated Show resolved Hide resolved
python/dgl/label_informativeness.py Outdated Show resolved Hide resolved
python/dgl/label_informativeness.py Outdated Show resolved Hide resolved
@dgl-bot
Copy link
Collaborator

dgl-bot commented Dec 5, 2023

Not authorized to trigger CI. Please ask core developer to help trigger via issuing comment:

  • @dgl-bot

@dgl-bot
Copy link
Collaborator

dgl-bot commented Dec 5, 2023

Commit ID: 057b48854a1c454d2d1920a859c7c5863cb2c08c

Build ID: 3

Status: ❌ CI test failed in Stage [Authentication].

Report path: link

Full logs path: link

@dgl-bot
Copy link
Collaborator

dgl-bot commented Dec 5, 2023

Not authorized to trigger CI. Please ask core developer to help trigger via issuing comment:

  • @dgl-bot

@dgl-bot
Copy link
Collaborator

dgl-bot commented Dec 5, 2023

Commit ID: dbc9e94

Build ID: 4

Status: ❌ CI test failed in Stage [Authentication].

Report path: link

Full logs path: link

@OlegPlatonov
Copy link
Contributor Author

@rudongyu Thank you for your review and suggestions! I've rewritten the code to avoid loops, it's much faster now. Please take a look when you have time.

@dgl-bot
Copy link
Collaborator

dgl-bot commented Dec 6, 2023

Not authorized to trigger CI. Please ask core developer to help trigger via issuing comment:

  • @dgl-bot

@dgl-bot
Copy link
Collaborator

dgl-bot commented Dec 6, 2023

Commit ID: ee0bf3a

Build ID: 5

Status: ❌ CI test failed in Stage [Authentication].

Report path: link

Full logs path: link

@dgl-bot
Copy link
Collaborator

dgl-bot commented Dec 7, 2023

Not authorized to trigger CI. Please ask core developer to help trigger via issuing comment:

  • @dgl-bot

@OlegPlatonov OlegPlatonov force-pushed the adjusted_homophily_and_label_informativeness branch from 0af72aa to 0eedce6 Compare December 7, 2023 15:40
@dgl-bot
Copy link
Collaborator

dgl-bot commented Dec 7, 2023

Commit ID: d2ebca96bc827ec87678623b6dca4cf75a2df841

Build ID: 6

Status: ❌ CI test failed in Stage [Authentication].

Report path: link

Full logs path: link

@dgl-bot
Copy link
Collaborator

dgl-bot commented Dec 7, 2023

Not authorized to trigger CI. Please ask core developer to help trigger via issuing comment:

  • @dgl-bot

@dgl-bot
Copy link
Collaborator

dgl-bot commented Dec 11, 2023

Not authorized to trigger CI. Please ask core developer to help trigger via issuing comment:

  • @dgl-bot

@rudongyu
Copy link
Collaborator

@dgl-bot

@dgl-bot
Copy link
Collaborator

dgl-bot commented Dec 11, 2023

Commit ID: babe0a3

Build ID: 21

Status: ❌ CI test failed in Stage [Authentication].

Report path: link

Full logs path: link

@dgl-bot
Copy link
Collaborator

dgl-bot commented Dec 11, 2023

Commit ID: babe0a3

Build ID: 22

Status: ❌ CI test failed in Stage [Torch GPU Unit test].

Report path: link

Full logs path: link

@dgl-bot
Copy link
Collaborator

dgl-bot commented Dec 11, 2023

Not authorized to trigger CI. Please ask core developer to help trigger via issuing comment:

  • @dgl-bot

@dgl-bot
Copy link
Collaborator

dgl-bot commented Dec 11, 2023

Commit ID: a8fa597

Build ID: 23

Status: ❌ CI test failed in Stage [Authentication].

Report path: link

Full logs path: link

@rudongyu
Copy link
Collaborator

@dgl-bot

@dgl-bot
Copy link
Collaborator

dgl-bot commented Dec 11, 2023

Not authorized to trigger CI. Please ask core developer to help trigger via issuing comment:

  • @dgl-bot

@dgl-bot
Copy link
Collaborator

dgl-bot commented Dec 11, 2023

Commit ID: 196adc1

Build ID: 24

Status: ❌ CI test failed in Stage [Authentication].

Report path: link

Full logs path: link

@dgl-bot
Copy link
Collaborator

dgl-bot commented Dec 11, 2023

Not authorized to trigger CI. Please ask core developer to help trigger via issuing comment:

  • @dgl-bot

@dgl-bot
Copy link
Collaborator

dgl-bot commented Dec 11, 2023

Commit ID: ba97ec2

Build ID: 26

Status: ❌ CI test failed in Stage [Authentication].

Report path: link

Full logs path: link

@dgl-bot
Copy link
Collaborator

dgl-bot commented Dec 11, 2023

Not authorized to trigger CI. Please ask core developer to help trigger via issuing comment:

  • @dgl-bot

@dgl-bot
Copy link
Collaborator

dgl-bot commented Dec 11, 2023

Commit ID: 7baf335

Build ID: 27

Status: ❌ CI test failed in Stage [Authentication].

Report path: link

Full logs path: link

@dgl-bot
Copy link
Collaborator

dgl-bot commented Dec 11, 2023

Commit ID: 196adc1

Build ID: 25

Status: ❌ CI test failed in Stage [Torch GPU Unit test].

Report path: link

Full logs path: link

@dgl-bot
Copy link
Collaborator

dgl-bot commented Dec 11, 2023

Not authorized to trigger CI. Please ask core developer to help trigger via issuing comment:

  • @dgl-bot

@dgl-bot
Copy link
Collaborator

dgl-bot commented Dec 11, 2023

Commit ID: c6a6d6e

Build ID: 28

Status: ❌ CI test failed in Stage [Authentication].

Report path: link

Full logs path: link

@dgl-bot
Copy link
Collaborator

dgl-bot commented Dec 11, 2023

Not authorized to trigger CI. Please ask core developer to help trigger via issuing comment:

  • @dgl-bot

@rudongyu
Copy link
Collaborator

@dgl-bot

@dgl-bot
Copy link
Collaborator

dgl-bot commented Dec 11, 2023

Commit ID: 803d026

Build ID: 29

Status: ❌ CI test failed in Stage [Authentication].

Report path: link

Full logs path: link

@dgl-bot
Copy link
Collaborator

dgl-bot commented Dec 11, 2023

Commit ID: 803d026

Build ID: 30

Status: ✅ CI test succeeded.

Report path: link

Full logs path: link

Copy link
Collaborator

@rudongyu rudongyu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@OlegPlatonov Thank you for your contribution! The PR will be merged.

@rudongyu rudongyu merged commit ffe2871 into dmlc:master Dec 11, 2023
2 checks passed
DominikaJedynak pushed a commit to DominikaJedynak/dgl that referenced this pull request Mar 12, 2024
Co-authored-by: rudongyu <ru_dongyu@outlook.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants