This repo provides a implementation of CasSampling as described in the paper:
CasSampling: Exploring Efficient Cascade Graph Learning for Popularity Prediction
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
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
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:
- Twitter (Weng et al., Virality Prediction and Community Structure in Social Network, Scientific Report, 2013).You can also download Twitter dataset here in here.
- Weibo (Cao et al., DeepHawkes: Bridging the Gap between Prediction and Understanding of Information Cascades, CIKM, 2017). You can also download Weibo dataset here in here.