class_docstr: Class for generating a graph object from a dataset.
  
  Prepare Graph object from a dataset file.
  
  Parameters
  ----------
  graph_matrix_path : string
      Path to graph adjacency matrix.
  labels_path : string
      Path to labels of the nodes of the graph.
  
  Attributes
  ----------
  edges : dict
      Dictionary with node number as key
      and edge connected node numbers as values.
  n_nodes : int
      Number of nodes in the graph.
  labels : dict
      Dictionary with node number as key and the true label number as values.
class_docstr_tok: ["Class","for","generating","a","graph","object","from","a","dataset",".","Prepare","Graph","object","from","a","dataset","file",".","Parameters","--","--","--","--","--","graph_matrix_path",":","string","Path","to","graph","adjacency","matrix",".","labels_path",":","string","Path","to","labels","of","the","nodes","of","the","graph",".","Attributes","--","--","--","--","--","edges",":","dict","Dictionary","with","node","number","as","key","and","edge","connected","node","numbers","as","values",".","n_nodes",":","int","Number","of","nodes","in","the","graph",".","labels",":","dict","Dictionary","with","node","number","as","key","and","the","true","label","number","as","values","."]
docstr: Compute a set of random walks on a graph.
  
  For each node of the graph, generates a a number of
  random walks of a specified length.
  Two consecutive nodes in the random walk, are necessarily
  related with an edge. The walks capture the structure of the graph.
  
  Parameters
  ----------
  walk_length : int
      Length of a random walk in terms of number of edges.
  n_walks_per_node : int
      Number of generated walks starting from each node of the graph.
  
  Returns
  -------
  self : array-like, shape=[n_walks_per_node*self.n_edges, walk_length]
      Array containing random walks.
docstr_tok: ["Compute","a","set","of","random","walks","on","a","graph",".","For","each","node","of","the","graph",",","generates","a","a","number","of","random","walks","of","a","specified","length",".","Two","consecutive","nodes","in","the","random","walk",",","are","necessarily","related","with","an","edge",".","The","walks","capture","the","structure","of","the","graph",".","Parameters","--","--","--","--","--","walk_length",":","int","Length","of","a","random","walk","in","terms","of","number","of","edges",".","n_walks_per_node",":","int","Number","of","generated","walks","starting","from","each","node","of","the","graph",".","Returns","--","--","--","-","self",":","array-like",",","shape=","[","n_walks_per_node","*","self.n_edges",",","walk_length","]","Array","containing","random","walks","."]
code: def random_walk(self, walk_length=5, n_walks_per_node=1):
      """Compute a set of random walks on a graph.
  
      For each node of the graph, generates a a number of
      random walks of a specified length.
      Two consecutive nodes in the random walk, are necessarily
      related with an edge. The walks capture the structure of the graph.
  
      Parameters
      ----------
      walk_length : int
          Length of a random walk in terms of number of edges.
      n_walks_per_node : int
          Number of generated walks starting from each node of the graph.
  
      Returns
      -------
      self : array-like, shape=[n_walks_per_node*self.n_edges, walk_length]
          Array containing random walks.
      """
      paths = [
          [0] * (walk_length + 1)
          for i in range(self.n_nodes * n_walks_per_node)
      ]
  
      for index in range(len(self.edges)):
          for i in range(n_walks_per_node):
              paths[index * n_walks_per_node + i] = self._walk(
                  index, walk_length
              )
      return gs.array(paths)
  
file_path: geomstats/geomstats/datasets/prepare_graph_data.py
imports: import logging
  import random
  import geomstats.backend
  from geomstats.geometry.poincare_ball import PoincareBall
label_desc: Use image node_id 2 for calling the Graph obj's underlying member method code with example usage: obj.random_walk(walk_length, n_walks_per_node) and returns: gs