class_docstr: Class to calculate probability (pmf) values specific to Bayesian Models
  
  Parameters
  ----------
  model: Bayesian Model
      model on which inference queries will be computed
class_docstr_tok: ["Class","to","calculate","probability","(","pmf",")","values","specific","to","Bayesian","Models","Parameters","--","--","--","--","--","model",":","Bayesian","Model","model","on","which","inference","queries","will","be","computed"]
docstr: Get probability array-maps for a node as function of conditional dependencies
  
  Internal function used for Bayesian networks, eg. in BayesianModelSampling
  and BayesianModelProbability.
  
  Parameters
  ----------
  variable: Bayesian Model Node
      node of the Bayesian network
  
  evidence: list
      List of evidence variables to compute the reduced values for. Rest
      of the parent varaibles of the node are marginalized.
  
  state_combinations: list (default=None)
      List of tuple of state combinations for which to compute the reductions maps.
  
  Returns
  -------
  dict: dictionary with probability array-index for node as function of conditional dependency values,
      dictionary with mapping of probability array-index to probability array.
docstr_tok: ["Get","probability","array-maps","for","a","node","as","function","of","conditional","dependencies","Internal","function","used","for","Bayesian","networks",",","eg",".","in","BayesianModelSampling","and","BayesianModelProbability",".","Parameters","--","--","--","--","--","variable",":","Bayesian","Model","Node","node","of","the","Bayesian","network","evidence",":","list","List","of","evidence","variables","to","compute","the","reduced","values","for",".","Rest","of","the","parent","varaibles","of","the","node","are","marginalized",".","state_combinations",":","list","(","default=None",")","List","of","tuple","of","state","combinations","for","which","to","compute","the","reductions","maps",".","Returns","--","--","--","-","dict",":","dictionary","with","probability","array-index","for","node","as","function","of","conditional","dependency","values",",","dictionary","with","mapping","of","probability","array-index","to","probability","array","."]
code: def pre_compute_reduce_maps(
      self, variable, evidence=None, state_combinations=None
  ):
      """
      Get probability array-maps for a node as function of conditional dependencies
  
      Internal function used for Bayesian networks, eg. in BayesianModelSampling
      and BayesianModelProbability.
  
      Parameters
      ----------
      variable: Bayesian Model Node
          node of the Bayesian network
  
      evidence: list
          List of evidence variables to compute the reduced values for. Rest
          of the parent varaibles of the node are marginalized.
  
      state_combinations: list (default=None)
          List of tuple of state combinations for which to compute the reductions maps.
  
      Returns
      -------
      dict: dictionary with probability array-index for node as function of conditional dependency values,
          dictionary with mapping of probability array-index to probability array.
      """
      variable_cpd = self.model.get_cpds(variable)
      if evidence is None:
          evidence = [
              var
              for var in variable_cpd.variables[1:]
              if var not in self.model.latents
          ]
  
      if state_combinations is None:
          state_combinations = [
              tuple(sc)
              for sc in itertools.product(
                  *[range(self.cardinality[var]) for var in evidence]
              )
          ]
  
      reduce_index = [
          variable_cpd.variables.index(var) for var in evidence
      ]
  
      weights_list = compat_fns.stack(
          [
              BayesianModelInference._reduce_marg(
                  variable_cpd, evidence, reduce_index, sc
              )
              for sc in state_combinations
          ]
      )
      unique_weights, weights_indices = compat_fns.unique(
          weights_list, axis=0, return_inverse=True
      )
  
      # convert weights to index; make mapping of state to index
      state_to_index = dict(zip(state_combinations, weights_indices))
  
      # make mapping of index to weights
      index_to_weight = dict(enumerate(unique_weights))
  
      # return mappings of state to index, and index to weight
      return state_to_index, index_to_weight
  
imports: import itertools
  import math
  import os
  import networkx
  import numpy
  import pandas
  from joblib import Parallel, delayed
  from pgmpy.inference import Inference
  from pgmpy.utils import _check_1d_array_object, _check_length_equal, compat_fns
label_desc: Use image node_id 4 for calling the BayesianModelInference obj's underlying member method code with example usage: obj.pre_compute_reduce_maps(variable, evidence, state_combinations) and returns: state_to_index,  index_to_weight