This is a Python implementation of the paper node2vec: Scalable Feature Learning for Networks accepted in KDD2016.
In a Data Science class (IFT-6758 at UdeM/Mila), we were given the task to predict age, gender
and personality traits of users from a social network website. One of the data sources was a Relation.csv
file, which was essentially an edge list between users and liked pages. We implemented node2vec
to do feature extraction on the relational data, which was subsequently concatenated with other data
sources (pictures, text) in a multimodal approach. Since the data is private, we incorporated two fake
Relations.csv in .tests/Relation/
that show how the data was constructed. To run the model,
simply write
python -m src.learn_features --type relation
Other hyperparameters can be specified (min_like, p, q values of node2vec biased random walk) as command-line arguments.
We also reproduced the results from node2vec paper on the BlogCatalog dataset to test our implementation. To run the feature extraction run the command:
python -m src.learn_features --type blogcatalog --p 0.25 --q 0.25 --min_like 0
After node2vec training, you can test the learned features of BlogCatalog Dataset by running the command:
python -m src.multilabel_blogCatalog --path 'path of features' --label 'path of labels' --k 'integer k for k-fold validation'