jwalk
jwalk performs random walks on a graph and learns representations for nodes using Word2Vec. It also has options to train existing models online and specify weights.
Install
pip install -U jwalk
Build
make build
Usage
jwalk -i tests/data/karate.edgelist -o karate.emb --delimiter=' '
To see the full list of options:
jwalk --help Prompt parameters: debug: drop a debugger if an exception is raised delimiter: delimiter for input file embedding-size: dimension of word2vec embedding (default=200) has-header: boolean if csv has header row help (-h): argparse help input (-i): file input (edgelist of 2/3 cols or adjacency matrix) log-level (-l) logging level (default=INFO) model (-m): use a pre-existing model num-walks (-n): number of of random walks per graph (default=1) output (-o): file output stats: boolean to calculate walk statistics [requires pandas] undirected: make graph undirected walk-length: length of random walks (default=10) window-size: word2vec window size (default=5) workers: number of workers (default=multiprocessing.cpu_count)
Input File
The input file can be of the following formats:
Edgelist: CSV with 2 or 3 columns denoting the source, target and (optional) weight. There are CLI options to specify the delimiter and whether the file has a header (default=False). The CSV file is loaded using numpy if pandas is not installed. We strongly recommend using pandas to load the CSV as it’s a lot faster.
Graph: If the file has an extension that is “.npz”, jwalk will assume that it is a SciPy CSR matrix. Included must be keys of data, indices, indptr, shape and labels (default=None) where labels are the node labels. For an example, see tests/data/karate.npz.
Test
Running unit tests:
make test
Running linter:
make lint
Running tox:
make test-all
Blog
Read more about jwalk in our blog post here: https://www.jwplayer.com/blog/deepwalk-recommendations/
License
Apache License 2.0
References
[paper]: arXiv:1403.6652 [cs.SI] “DeepWalk: Online Learning of Social Representations”
[paper]: arXiv:1607.00653 [cs.SI] “node2vec: Scalable Feature Learning for Networks”
Metadata
Release files for jwalk 0.5.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| jwalk-0.5.3.tar.gz | 355.9 kB | Without provenance | Details for jwalk-0.5.3.tar.gz |
Release files / jwalk-0.5.3.tar.gz
| Download URL | jwalk-0.5.3.tar.gz |
|---|---|
| Size | 355.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ac6440544241f3e6000b053119a22a7d0d90c443ae468702d2ea7e065e3762a7
|
|
BLAKE2b-256 checksum How to use checksums |
5aba4bcecb790787ac81898daded7c32df06631aae5797107a463289fcbf0fd8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for jwalk 0.5.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.