Skip to content

Node2Vec implementation using only pandas, numpy and gensim

Notifications You must be signed in to change notification settings

philqc/node2vec

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

89 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 features' --label 'path of labels' --k 'integer 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

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published