Skip to main content

Graph embeddings for downstream tasks

Project description

Tests Codecov PythonVersion PyPi Docs

Graph-Embeddings

Graph embeddings for downstream tasks

https://raw.githubusercontent.com/rodrigo-arenas/Graph-Embeddings/main/docs/images/graph_embeddings.png?raw=true

Installation:

It’s advised to install graph-embeddings using a virtual env, inside the env use:

pip install graph-embeddings

Algorithms:

StackedNode2Vec

Computes the Node2Vec representation of each node in a set of graphs.

Example:

import networkx as nx
from graph_embeddings.algorithms import StackedNode2Vec

g1 = nx.DiGraph()
g2 = nx.DiGraph()
g1.add_edges_from([("A", "B"), ("B", "C"), ("C", "B"), ("B", "E")])
g2.add_edges_from([("A", "B"), ("B", "D"), ("D", "C"), ("C", "D")])

graphs = [g1, g2]
embedding_model = StackedNode2Vec()
embedding_model.fit(graphs)

embedding_model.get_embeddings()  # ndarray with shape (2, 5, 128) - graphs, nodes, embedding_size
embedding_model.get_dense_embeddings()  # ndarray with shape (2, 640) - graphs, nodes*embedding_size

Changelog

See the changelog for notes on the changes of graph-embeddings

Source code

You can check the latest development version with the command:

git clone https://github.com/rodrigo-arenas/graph-embeddings.git

Install the development dependencies:

pip install -r dev-requirements.txt

Check the latest in-development documentation: https://graph-embeddings.readthedocs.io/en/latest/

Contributing

Contributions are more than welcome! There are several opportunities on the ongoing project, so please get in touch if you would like to help out. Make sure to check the current issues and also the Contribution guide.

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

graph-embeddings-0.1.0.tar.gz (7.3 kB view hashes)

Uploaded Source

Built Distribution

graph_embeddings-0.1.0-py3-none-any.whl (7.7 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