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: Method to compute values of the `variable_cpd` when it it reduced on
  `variable_evid` with states `sc_values`. Rest of the evidence variables
  of `variable_cpd` are marginalized. This is a stripped down version
  DiscreteFactor.reduce to only compute the values for faster runtime.
  
  Parameters
  ----------
  variable_cpd: Instance of pgmpy.factors.discrete.TabularCPD
      The CPD that will be reduced.
  
  variable_evid: list
      List of variable name that need to be reduced.
  
  sc_values: list
      list of list of states (corresponding to variable_evid) to which to
      reduce the CPD.
  
  Returns
  -------
  list: List of np.array with each element representing the reduced
          values correponding to the states in sc_values.
docstr_tok: ["Method","to","compute","values","of","the","`","variable_cpd","`","when","it","it","reduced","on","`","variable_evid","`","with","states","`","sc_values","`",".","Rest","of","the","evidence","variables","of","`","variable_cpd","`","are","marginalized",".","This","is","a","stripped","down","version","DiscreteFactor.reduce","to","only","compute","the","values","for","faster","runtime",".","Parameters","--","--","--","--","--","variable_cpd",":","Instance","of","pgmpy.factors.discrete.TabularCPD","The","CPD","that","will","be","reduced",".","variable_evid",":","list","List","of","variable","name","that","need","to","be","reduced",".","sc_values",":","list","list","of","list","of","states","(","corresponding","to","variable_evid",")","to","which","to","reduce","the","CPD",".","Returns","--","--","--","-","list",":","List","of","np.array","with","each","element","representing","the","reduced","values","correponding","to","the","states","in","sc_values","."]
code: def _reduce_marg(variable_cpd, variable_evid, reduce_index, sc):
      """
      Method to compute values of the `variable_cpd` when it it reduced on
      `variable_evid` with states `sc_values`. Rest of the evidence variables
      of `variable_cpd` are marginalized. This is a stripped down version
      DiscreteFactor.reduce to only compute the values for faster runtime.
  
      Parameters
      ----------
      variable_cpd: Instance of pgmpy.factors.discrete.TabularCPD
          The CPD that will be reduced.
  
      variable_evid: list
          List of variable name that need to be reduced.
  
      sc_values: list
          list of list of states (corresponding to variable_evid) to which to
          reduce the CPD.
  
      Returns
      -------
      list: List of np.array with each element representing the reduced
              values correponding to the states in sc_values.
      """
      try:
          values = [
              variable_cpd.get_state_no(variable_evid[i], sc[i])
              for i in range(len(sc))
          ]
      except KeyError:
          values = sc
  
      slice_ = [slice(None) for i in range(len(variable_cpd.variables))]
      for i, index in enumerate(reduce_index):
          slice_[index] = values[i]
  
      reduced_values = variable_cpd.values[tuple(slice_)]
      marg_values = compat_fns.einsum(
          reduced_values, range(reduced_values.ndim), [0]
      )
      return marg_values / marg_values.sum()
  
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 3 for calling the BayesianModelInference obj's underlying member method code with example usage: obj._reduce_marg(variable_cpd, variable_evid, reduce_index, sc) and returns: unknown