Code for paper on role action embeddings
Berry, George. "Role action embeddings: scalable representation of network positions." arXiv preprint arXiv:1811.08019 (2018).
This was created using Python 3, it may not work with Python 2. All packages were installed using Anaconda's miniconda distribution.
We include slightly modified versions of the node2vec and GraphWave repos for comparison.
We use model loading code from Kipf and Welling.
Graph classification datasets were downloaded here.
Node classification datasets can be found here, but we use the specific splits provided here.
Model code was adapted from Hamilton et al's code.
Make sure you have the dependencies installed. These are: scikit-learn
, numpy
, pandas
, networkx
, matplotlib
, seaborn
, pytorch
, gensim
, jupyter
, scipy
- Open a Jupyter notebook with
jupyter notebook
at the command line and opensmall_graphs.ipynb
- There are four notebooks, one for Cora, one for Citeseer, one for Pubmed, and one for all of the graph classification tasks
- Unzip
empirical_graphs/data.zip
empirical_graphs/models.py
, you should set thebase_data_path
variable to point to thedata
folder on your machine. Data is contained in theempirical_graphs/data
folder- For the graph classification, the
REDDIT-MULTI-12k
files are quite large, please download it from here.
- They're leftovers from my original runs to generate the results in the paper. I then went back and cleaned up the code. You can ignore them, but I wanted to keep them around for posterity.