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].get("weight", 1.0)
              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] = create_alias_table(normalized_probs)
  
      if not self.use_rejection_sampling:
          alias_edges = {}
  
          for edge in G.edges():
              alias_edges[edge] = self.get_alias_edge(edge[0], edge[1])
              if not G.is_directed():
                  alias_edges[(edge[1], edge[0])] = self.get_alias_edge(
                      edge[1], edge[0]
                  )
              self.alias_edges = alias_edges
  
      self.alias_nodes = alias_nodes
      return
  
imports: import itertools
  import math
  import random
  import pandas
  from joblib import Parallel, delayed
  from .alias import alias_sample, create_alias_table
  from .utils import partition_num
label_desc: Use image node_id 8 for calling the RandomWalker obj's underlying member method code with example usage: obj.preprocess_transition_probs() without return types