This repository stores the source code and some preprocessed data of Group 12 for the final project of EE226 in SJTU.
For more details please refer to our paper.
- 0.51895 mean F1-score (2nd) on private leaderboard of node classification
- 0.79756 AUC score (2nd) on private leaderboard of link prediction
Note: Combining our SEAL
solution with node2vec+lightgbm
solution, we achieve 0.81069 on link prediction.
We use a conda environment with python 3.7.0. Key packages (with necessary dependencies):
- pytorch 1.8.1
- torch-geometric 1.7.0
- lightgbm 3.1.1
Lower version of these packages might also work fine, but we only test with the specified versions above.
Some basic packages like numpy, pandas, scipy, and tqdm are also required, and conda/pip makes things fine.
For task 1 (node classification), just enter the node
directory and run the following command to check our results:
mkdir submission # if this directory does not exist
mkdir models # if this directory does not exist
mkdir models/saves # if this directory does not exist
python example.py
Some parameters can be set by passing arguments.
For example, if you want to use GCN rather than default SGC as single GNN layers, run the following command:
python example.py --conv GCN
At present, some parameters are not supported to be set directly by passing arguments.
If you want to revise them, check utils.py
and example.py
.
For task 2 (link prediction), just enter the link
directory and run the following command to check our results:
mkdir submission # if this directory does not exist
mkdir models # if this directory does not exist
mkdir models/saves # if this directory does not exist
python src/seal.py
Some parameters can be set by passing arguments.
For example, if you want to eliminate our ensemble learning trick, run the following command:
python src/seal.py --n_models 1
At present, some parameters are not supported to be set directly by passing arguments.
If you want to revise them, check utils.py
, seal_utils.py
and seal.py
.
We also provide node2vec
and metapath2vec
demo:
node2vec.py
: Generate node embeddings using node2vec.metapath2vec.py
: Generate node embeddings using metapath2vec.n2v_pred.py
: Solve link prediction using node embeddings.
Trained embeddings (.npy files) are provided under the link
folder.
Demo of generative models are to be updated in the future.
[1] A. Grover, and J. Leskovec. node2vec: Scalable Feature Learning for Networks, KDD 16'.
[2] Y. Dong, N. Chawla, et al. metapath2vec: Scalable Representation Learning for Heterogeneous Networks, KDD 17'.
[3] F. Wu, T. Zhang, et al. Simplifying Graph Convolutional Networks, ICML 19'.
[4] Y. Rong, W. Huang, et al. DropEdge: Towards Deep Graph Convolutional Networks on Node Classification, ICLR 20'.
[5] M. Zhang, and Y. Chen. Link Prediction Based on Graph Neural Networks, NeurIPS 18'.