Skip to content

Latest commit

 

History

History
executable file
·
43 lines (27 loc) · 1.81 KB

README.md

File metadata and controls

executable file
·
43 lines (27 loc) · 1.81 KB

node2vec-java

This repository is an implementation of node2vec using Java.

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

node2vec: Scalable Feature Learning for Networks. A. Grover, J. Leskovec. ACM SIGKDD International Conference on Knowledge Discovery and Data Mining (KDD), 2016.

The original oficial Python implementation can be found in this repository.

Basic Usage

Example

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

Options

You can check out the other options available to use with node2vec using:
java -jar node2vec.jar --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.

Library