/CasSampling

[ECML/PKDD 2023] This is the Pytorch code for our paper "CasSampling: Exploring Efficient Cascade Graph Learning for Popularity Prediction".

Primary LanguagePython

CasSampling

This repo provides a implementation of CasSampling as described in the paper:

CasSampling: Exploring Efficient Cascade Graph Learning for Popularity Prediction

Basic Usage

Requirements

The code was tested with python 3.9, torch 1.11.0, cudatoolkit 11.3, and cudnn 8.2.0. Install the dependencies via Anaconda:

# create virtual environment
conda create --name CasSampling python=3.9 

# activate environment
conda activate CasSampling

# install torch and other requirements
conda install pytorch torchvision torchaudio pytorch-cuda=11.3 -c pytorch -c nvidia
pip install -r requirements.txt

Run the code

cd ./preprocessing

##Preprocessing the data, Then transform the datasets to the format of ".pkl" command:
python utils.py
python preprocess_graph.py
#you can change the dataset, observation time, and parameter in config.py

# run CasSampling model
cd ./CasSampling_model
python run_CasSampling.py

Datasets

See some sample cascades in ./data/twitter/dataset.txt.

Weibo or Twitter Datasets download link: Google Drive

The datasets we used in the paper are come from: