Giter VIP home page Giter VIP logo

struc2vec's Introduction

struc2vec

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

struc2vec: Learning Node Representations from Structural Identity.
Leonardo F. R. Ribeiro, Pedro H. P. Saverese, Daniel R. Figueiredo.
Knowledge Discovery and Data Mining, SigKDD, 2017.

The struc2vec algorithm learns continuous representations for nodes in any graph. struc2vec captures structural equivalence between nodes.

Before to execute struc2vec, it is necessary to install the following packages:
pip install futures
pip install fastdtw
pip install gensim

Basic Usage

Example

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

Options

To activate optimization 1, use the following option: --OPT1 true
To activate optimization 2: --OPT2 true
To activate optimization 3: --OPT3 true

To run struc2vec on Barbell network, using all optimizations, execute the following command from the project home directory:
python src/main.py --input graph/barbell.edgelist --output emb/barbell.emb --num-walks 20 --walk-length 80 --window-size 5 --dimensions 2 --OPT1 True --OPT2 True --OPT3 True --until-layer 6

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

Input

The supported input format is an edgelist:

node1_id_int node2_id_int

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 struc2vec.

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 framework struc2vec.

struc2vec's People

Contributors

leoribeiro avatar lolemacs avatar lookfwd avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.