WalkingModel
- class mowl.walking.WalkingModel(num_walks, walk_length, outfile, workers=1)[source]
Bases:
object
Base class for walking methods.
- Parameters:
Methods Summary
This method waits until all the walks are written to the output file.
walk
(edges[, nodes_of_interest])This method will generate random walks from a graph in the form of edgelist.
Methods Documentation
- walk(edges, nodes_of_interest=None)[source]
This method will generate random walks from a graph in the form of edgelist.
- Parameters:
edges (
mowl.projection.edge.Edge
) – List of edgesnodes_of_interest (list, optional) – List of entity names to filter the generated walks. If a walk contains at least one word of interest, it will be saved into disk, otherwise it will be ignored. If no list is input, all the nodes will be considered. Defaults to
None
Changed in version 0.1.0: The method now can accept a list of entities to focus on when generating the random walks.