leohsuofnthu / node2vec

Node2Vec implementation using only pandas, numpy and gensim

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

node2vec: Scalable Feature Learning for Networks

This is a Python implementation of the paper node2vec: Scalable Feature Learning for Networks accepted in KDD2016.

Example Tasks

(1) Feature extraction with Relations dataset

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.

(2) Multi-Label Classfication with BlogCatalog dataset

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 learned features' --k 'number of k for k-fold validation' 

Authors

  • PHILLIPPE BEARDSELL - Professional Machine Learning Master Student at Mila
  • HSU, CHIH-CHAO - Professional Machine Learning Master Student at Mila

About

Node2Vec implementation using only pandas, numpy and gensim


Languages

Language:Python 99.6%Language:Shell 0.4%