Skip to main content

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 create_dynamic_graph

# Create random graphs
graphs = create_dynamic_graph(
  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

Metadata

Release files for dynnode2vec 0.3.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dynnode2vec 0.3.1
File Size Uploaded
dynnode2vec-0.3.1.tar.gz 10.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for dynnode2vec 0.3.1
File Interpreter ABI Platform
dynnode2vec-0.3.1-py3-none-any.whl Python 3 none any Details

Total release size: 20.3 kB

Release files / dynnode2vec-0.3.1.tar.gz

Download URL dynnode2vec-0.3.1.tar.gz
Size 10.7 kB
Tags Source
SHA-256 checksum
How to use checksums
e5da8081555af8a80570d1d3263502fa58dfc4e79fd6ee19433caaaa542381fe
BLAKE2b-256 checksum
How to use checksums
b74bdb7a92026dee5c3d50245d4fb38e831546026110a78079bea61ee64dae88
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.14 CPython/3.8.3 Darwin/21.6.0

Release files / dynnode2vec-0.3.1-py3-none-any.whl

Download URL dynnode2vec-0.3.1-py3-none-any.whl
Size 9.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
955570aab2fa4dd519b168541021a73a8a40a93ab4ab3c08d414663800e3cd82
BLAKE2b-256 checksum
How to use checksums
b317c79a3103ed68fc0b1017bcd8915e9e76eeb588e855a13300f5cc57caaaa0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.14 CPython/3.8.3 Darwin/21.6.0

Release history Release notifications | RSS feed

This release

0.3.1 This release

2 release files

0.3.0

2 release files

0.2.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page