Code for Characterizing and Forecasting User Engagement with In-App Action Graphs: A Case Study of Snapchat
Temporal-gcn-lstm model encodes temporal evolving action graphs to predict future user engagement. The end-to-end, multi-channel neural model also encodes acitivity sequences and other macroscopic features to reach best performance.
DGL, NetworkX, PyTorch, Pandas, Numpy, SciKit-Learn, tqdm
Deep Graph Library (DGL) https://www.dgl.ai/
Pytorch https://pytorch.org/
build_graphs.py: build static graphs for time period
build_temporal.py: build temporal graphs per day
python3 build_graphs.py INPUT_PATH OUTPUT_PATH
python3 build_temporal.py INPUT_PATH OUTPUT_PATH
utils.py: supporting functions
activity_seq_model.py: baseline activity sequence model
gcn_model.py: model structure of our graph convolutional network
multi_channel.py: To run our final best performance temporal graph model
python3 multi_channel.py
Load custom data with df_path
graphs_path
macro_path
flags
Set variants of model with --activity
--macro
flags to inlcude or leave out these information.
ex. --activity False
. Default for both are True
for best enhanced performance of model.
Hyperparameters were set to optimal for our dataset, they can be modified as input arguments.