Giter Site home page Giter Site logo

haoyang-219 / cflp Goto Github PK

View Code? Open in Web Editor NEW

This project forked from dm2-nd/cflp

0.0 0.0 0.0 28.77 MB

Author: Tong Zhao ([email protected]). ICML 2022. Learning from Counterfactual Links for Link Prediction

License: Apache License 2.0

Python 100.00%

cflp's Introduction

Learning from Counterfactual Links for Link Prediction

This repository contains the source code for the ICML 2022 paper:

Learning from Counterfactual Links for Link Prediction

by Tong Zhao ([email protected]), Gang Liu, Daheng Wang, Wenhao Yu, and Meng Jiang.

Requirements

This code package was developed and tested with Python 3.8.5, PyTorch 1.6.0, and PyG 1.6.1. All dependencies specified in the requirements.txt file. The packages can be installed by

pip install -r requirements.txt

Usage

The step of finding all the counterfactual links can be slow for the first run, please adjust the --n_workers parameter according to available processes if you are trying out different settings. The cached files for the counterfactual links that were used in our experiments can be found here, please download and put them under data/T_files/ before reproducing our experiments.

Following are the commands to reproduce our experiment results on different datasets.

# Cora
python main.py --dataset cora --metric auc --alpha 1 --beta 1 --gamma 30 --lr 0.1 --embraw mvgrl --t kcore --neg_rate 50 --jk_mode mean --trail 20

# CiteSeer
python main.py --dataset citeseer --metric auc --alpha 1 --beta 1 --gamma 30 --lr=0.1 --embraw dgi --t kcore --neg_rate 50 --jk_mode mean --trail 20

# PubMed
python main.py --dataset pubmed --metric auc --alpha 1 --beta 1 --gamma 30 --lr 0.1 --embraw mvgrl --t kcore --neg_rate 40 --jk_mode mean --batch_size 12000 --epochs 200 --patience 50 --trail 20

# Facebook
python main.py --dataset facebook --metric hits@20 --alpha 1e-3 --beta 1e-3 --gamma 30 --lr 0.005 --embraw mvgrl --t louvain --neg_rate 1 --jk_mode mean --trail 20

# OGBL-ddi
python main.py --dataset ogbl-ddi --metric hits@20 --alpha 1e-3 --beta 1e-3 --gamma 10 --lr 0.01 --embraw dgi --t louvain  --neg_rate 1 --jk_mode mean --epochs=200 --epochs_ft=200 --patience=50 --trail 20

Cite

If you find this repository useful in your research, please cite our paper:

@article{zhao2021counterfactual,
  title={Counterfactual Graph Learning for Link Prediction},
  author={Zhao, Tong and Liu, Gang and Wang, Daheng and Yu, Wenhao and Jiang, Meng},
  journal={arXiv preprint arXiv:2106.02172},
  year={2021}
}

cflp's People

Contributors

zhao-tong avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.