docstr: Preprocessing of transition probabilities for guiding the random walks.
docstr_tok: ["Preprocessing","of","transition","probabilities","for","guiding","the","random","walks","."]
code: def preprocess_transition_probs(self):
      """
      Preprocessing of transition probabilities for guiding the random walks.
      """
      G = self.G
  
      alias_nodes = {}
      for node in G.nodes():
          unnormalized_probs = [
              G[node][nbr]["weight"] for nbr in G.neighbors(node)
          ]
          norm_const = sum(unnormalized_probs)
          normalized_probs = [
              float(u_prob) / norm_const
              for u_prob in unnormalized_probs
          ]
          alias_nodes[node] = alias_setup(normalized_probs)
  
      alias_edges = {}
      triads = {}
  
      look_up_dict = self.look_up_dict
      node_size = self.node_size
      for edge in G.edges():
          alias_edges[edge] = self.get_alias_edge(edge[0], edge[1])
  
      self.alias_nodes = alias_nodes
      self.alias_edges = alias_edges
  
      return
  
file_path: OpenNE/src/openne/walker.py
imports: from __future__ import print_function
  import random
  import numpy
  import multiprocessing
label_desc: Use image node_id 5 for calling the Walker obj's underlying member method code with example usage: obj.preprocess_transition_probs() without return types