README.rst 2.7 KB
Newer Older
B
Bryan Perozzi 已提交
1 2 3 4
===============================
DeepWalk
===============================

B
Bryan Perozzi 已提交
5 6
DeepWalk uses short random walks to learn representations for vertices in graphs.

B
Bryan Perozzi 已提交
7 8 9
Usage
-----

B
Bryan Perozzi 已提交
10 11
**Example Usage**
    ``$deepwalk --input example_graphs/karate.adjlist --output karate.embeddings``
B
Bryan Perozzi 已提交
12

B
Bryan Perozzi 已提交
13
**--input**:  *input_filename*
B
Bryan Perozzi 已提交
14

B
Bryan Perozzi 已提交
15
    1. ``--format adjlist`` for an adjacency list, e.g::
B
Bryan Perozzi 已提交
16

B
Bryan Perozzi 已提交
17 18 19 20 21 22 23 24 25 26 27 28 29 30
        1 2 3 4 5 6 7 8 9 11 12 13 14 18 20 22 32
        2 1 3 4 8 14 18 20 22 31
        3 1 2 4 8 9 10 14 28 29 33
        ...
    
    2. ``--format edgelist`` for an edge list, e.g::
    
        1 2
        1 3
        1 4
        ...
    
    3. ``--format mat`` for a Matlab MAT file containing an adjacency matrix
        (note, you must also specify the variable name of the adjacency matrix ``--matfile-variable-name``)
B
Bryan Perozzi 已提交
31

B
Bryan Perozzi 已提交
32
**--output**: *output_filename*
B
Bryan Perozzi 已提交
33

B
Bryan Perozzi 已提交
34
    The output representations in skipgram format - first line is header, all other lines are node-id and *d* dimensional representation::
B
Bryan Perozzi 已提交
35

B
Bryan Perozzi 已提交
36 37 38 39
        34 64
        1 0.016579 -0.033659 0.342167 -0.046998 ...
        2 -0.007003 0.265891 -0.351422 0.043923 ...
        ...
B
Bryan Perozzi 已提交
40

B
Bryan Perozzi 已提交
41 42
**Full Command List**
    The full list of command line options is available with ``$deepwalk --help``
B
Bryan Perozzi 已提交
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61

Requirements
------------
* numpy
* scipy

(may have to be independently installed) 



Installation
------------
#. cd deepwalk
#. pip install -r requirements.txt 
#. python setup.py install


Citing
------
B
Bryan Perozzi 已提交
62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79
If you find DeepWalk useful in your research, we ask that you cite the following paper::

    @inproceedings{Perozzi:2014:DOL:2623330.2623732,
     author = {Perozzi, Bryan and Al-Rfou, Rami and Skiena, Steven},
     title = {DeepWalk: Online Learning of Social Representations},
     booktitle = {Proceedings of the 20th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining},
     series = {KDD '14},
     year = {2014},
     isbn = {978-1-4503-2956-9},
     location = {New York, New York, USA},
     pages = {701--710},
     numpages = {10},
     url = {http://doi.acm.org/10.1145/2623330.2623732},
     doi = {10.1145/2623330.2623732},
     acmid = {2623732},
     publisher = {ACM},
     address = {New York, NY, USA},
     keywords = {deep learning, latent representations, learning with partial labels, network classification, online learning, social networks},
B
Bryan Perozzi 已提交
80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98
    } 

Misc
----

DeepWalk - Online learning of social representations.

* Free software: GPLv3 license
* Documentation: http://deepwalk.readthedocs.org.



.. image:: https://badge.fury.io/py/deepwalk.png
    :target: http://badge.fury.io/py/deepwalk

.. image:: https://travis-ci.org/phanein/deepwalk.png?branch=master
        :target: https://travis-ci.org/phanein/deepwalk

.. image:: https://pypip.in/d/deepwalk/badge.png
B
Bryan Perozzi 已提交
99
        :target: https://pypi.python.org/pypi/deepwalk