Python3 Implementation of the WireWalk Algorithm
Project description
wirewalk
Install
pip install wirewalk
Prerequisites
You will need
- Python3
- Networkx
- Numpy
- Gensim
- editdistance
I highly recommend installing an Anaconda environment. Future versions of WireWalk will be available on PyPI and conda.
How to use
import networkx as nx
from wirewalk.core import WireWalk, jaccard_coefficient, max_flow
# Create a graph
graph = nx.fast_gnp_random_graph(n=10, p=0.5)
# Instantiate a WireWalk object
wireWalk = WireWalk(graph, dimensions = 128, window = 10, walk_length = 80, num_walks = 10, workers = 1)
# Compute transition probabilities using jaccard coefficient transformation, generate walks, and embed nodes
model = wireWalk.fit(jaccard_coefficient)
# **MAX_FLOW and MIN_COST_MAX_FLOW ONLY WORK WITH GIVEN capacity**
# If weight exists, then
# nx.set_edge_attributes(graph, nx.get_edge_attributes(graph, "weight"), "capacity").
# Otherwise,
nx.set_edge_attributes(graph, 1, "capacity")
model = wireWalk.fit(max_flow)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
wirewalk-0.0.2.tar.gz
(10.1 kB
view hashes)