WalkingModel

class mowl.walking.WalkingModel(num_walks, walk_length, outfile, workers=1)[source]

Bases: object

Base class for walking methods.

Parameters:
  • num_walks (int) – Number of walks per node

  • walk_length (int) – Length of each walk

  • workers (int, optional) – Number of threads to be used for computing the walks, defaults to 1’

Methods Summary

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 edges

  • nodes_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.