Skip to main content

A weighted alternative to metapath2vec for heterogenous graph embedding

Project description

Weighted-Metapath2Vec

Weighted-Metapath2Vec is a Python package to embed heterogeneous graphs. The algorithm uses a weighted alternative to Metapath2vec to compute the embeddings. The embeddings can be used for downstream machine learning.

pre-commit

Installation

pip install weighted-metapath2vec

Usage

from weighted_metapath2vec import WeightedMetapath2VecModel

...  # Load a networkx graph as G

metapaths = [
    ['Article', 'Author', 'Article'],
    ['Author', 'Article', 'Author']
]

model = WeightedMetapath2VecModel(G,
                                  metapaths,
                                  walk_length=3,
                                  n_walks_per_node=20,
                                  embedding_dim=128)

node_embeddings = model.fit_transform()

...  # downstream task

Contributing

Use GitHub to fork and submit pull requests.

License

MIT License. See the LICENSE file.

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

weighted-metapath2vec-0.1.3.tar.gz (4.3 kB view hashes)

Uploaded Source

Built Distribution

weighted_metapath2vec-0.1.3-py3-none-any.whl (4.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