Metadata-Version: 2.1
Name: weighted-metapath2vec
Version: 0.1.3
Summary: A weighted alternative to metapath2vec for heterogenous graph embedding
Home-page: https://github.com/morteza/wmetapath2vec
License: MIT
Keywords: machine learning,graph embedding,metapath2vec
Author: Morteza Ansarinia
Author-email: ansarinia@me.com
Requires-Python: >=3.9,<3.11
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.9
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Dist: flake8 (>=4.0.1,<5.0.0)
Requires-Dist: gensim (>=4.1,<5.0)
Requires-Dist: networkx (>=2.8,<3.0)
Requires-Dist: scikit-learn (>=1.0,<2.0)
Project-URL: Repository, https://github.com/morteza/wmetapath2vec
Description-Content-Type: text/markdown

# Weighted Metapath2vec

Weighted is a Python package to embed heterogenous graph nodes using a weighted alternative of Metapath2vec technique. The embedding can be used for downstream machine learning tasks.

[![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white)](https://github.com/pre-commit/pre-commit)


## Installation

```
pip install wmetapath2vec
```

## Usage

```python
from wmetapath2vec 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
```

