Skip to content

Facebook上の交友関係に関するグラフから、Facebookユーザの属性を機械学習で予測するタスクを実施。そのために、グラフをベクトル化する手法node2vecの公式実装をfork

License

Notifications You must be signed in to change notification settings

Knt44kw/node2vec

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

node2vec

This repository provides a reference implementation of node2vec as described in the paper:

node2vec: Scalable Feature Learning for Networks.
Aditya Grover and Jure Leskovec.
Knowledge Discovery and Data Mining, 2016.

The node2vec algorithm learns continuous representations for nodes in any (un)directed, (un)weighted graph. Please check the project page for more details.

Basic Usage

Requirement (Added by Knt44kw)

To install libraries for running scripts in this repository, execute the following command from the project home directory:
pip install -r requirements.txt

Example

To run node2vec on Zachary's karate club network, execute the following command from the project home directory:
python src/main.py --input graph/karate.edgelist --output emb/karate.emd

Options

You can check out the other options available to use with node2vec using:
python src/main.py --help

Input

The supported input format is an edgelist:

node1_id_int node2_id_int <weight_float, optional>

The graph is assumed to be undirected and unweighted by default. These options can be changed by setting the appropriate flags.

Output

The output file has n+1 lines for a graph with n vertices. The first line has the following format:

num_of_nodes dim_of_representation

The next n lines are as follows:

node_id dim1 dim2 ... dimd

where dim1, ... , dimd is the d-dimensional representation learned by node2vec.

Citing

If you find node2vec useful for your research, please consider citing the following paper:

@inproceedings{node2vec-kdd2016,
author = {Grover, Aditya and Leskovec, Jure},
 title = {node2vec: Scalable Feature Learning for Networks},
 booktitle = {Proceedings of the 22nd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining},
 year = {2016}
}

Miscellaneous

Please send any questions you might have about the code and/or the algorithm to [email protected].

Note: This is only a reference implementation of the node2vec algorithm and could benefit from several performance enhancement schemes, some of which are discussed in the paper.

ディレクトリについて

document: Facebookのデータセットに関する説明が書かれたテキストファイルを格納したディレクトリ
emb: node2vecによりベクトル化された特徴ベクトルを格納したディレクトリ
facebook: Facebookのソーシャルグラフに関する属性を表した元データを格納したディレクトリ
graph: ソーシャルグラフのデータセットが格納されたディレクトリ
ipynb: node2vecと機械学習について属性推定を行ったスクリプトをまとめたディレクトリ
src: node2vecを実行するためのスクリプトをまとめたディレクトリ.今回は,これらを一部改変し,node2vecにより友人関係をベクトル化した.

成果物の数値的結果などについて

resultというディレクトリにresult_presentation.pdfに格納

About

Facebook上の交友関係に関するグラフから、Facebookユーザの属性を機械学習で予測するタスクを実施。そのために、グラフをベクトル化する手法node2vecの公式実装をfork

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Jupyter Notebook 99.8%
  • Python 0.2%