Skip to main content

dynnode2vec is a package to embed dynamic graphs

Project description

dynnode2vec

Python Version Dependencies Status

Code style: black License Coverage Report

dynnode2vec is a package to embed dynamic graphs.

It is the python implementation of S. Mahdavi, S. Khoshraftar, A. An: dynnode2vec: Scalable Dynamic Network Embedding. IEEE BigData 2018

Installation

pip install -U dynnode2vec

Usage

import pickle

from dynnode2vec.dynnode2vec import DynNode2Vec
from dynnode2vec.utils import generate_dynamic_graphs

# Create random graphs
graphs = generate_dynamic_graphs(
  n_base_nodes=100, n_steps=50, base_density=0.05
)

# Instantiate dynnode2vec object
dynnode2vec = DynNode2Vec(
    p=1., 
    q=1., 
    walk_length=10, 
    n_walks_per_node=20, 
    embedding_size=64
)

# Embed the dynamic graphs
embeddings = dynnode2vec.compute_embeddings(graphs)

# Save embeddings to disk
with open('example_embeddings.pkl', 'wb') as f:
    pickle.dump(embeddings, f)

Parameters

  • DynNode2Vec class:

    • p: Return hyper parameter (default: 1)
    • q: Inout parameter (default: 1)
    • walk_length: Number of nodes in each walk (default: 80)
    • n_walks_per_node: Number of walks per node (default: 10)
    • embedding_size: Embedding dimensions (default: 128)
    • seed: Number of workers for parallel execution (default: 1)
    • parallel_processes: Number of workers for parallel execution (default: 1)
    • use_delta_nodes: Number of workers for parallel execution (default: 1)
  • DynNode2Vec.fit method:

    • graphs: list of nx.Graph (ordered by time)

TO DO

  • remove pandas use in embeddings formatting
  • code examples of synthetic and real-life uses
  • get rid of Stellar Graph dependency

Releases

You can see the list of available releases on the GitHub Releases page.

License

This project is licensed under the terms of the MIT license. See LICENSE for more details.

Citation

@misc{dynnode2vec,
  author = {Paul-Emile Dugnat},
  title = {dynnode2vec, a package to embed dynamic graphs},
  year = {2022},
  publisher = {GitHub},
  journal = {GitHub repository},
  howpublished = {\url{https://github.com/pedugnat/dynnode2vec}}
}

This project was generated with python-package-template

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dynnode2vec-0.2.0.tar.gz (7.6 kB view hashes)

Uploaded Source

Built Distribution

dynnode2vec-0.2.0-py3-none-any.whl (6.8 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page