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"]
code: def __init__(self, model):
      from pgmpy.models import BayesianNetwork
  
      if not isinstance(model, BayesianNetwork):
          raise TypeError(
              f"Model expected type: BayesianNetwork, got type: {type(model)}"
          )
      super(BayesianModelInference, self).__init__(model)
      self._initialize_structures()
  
      self.topological_order = list(nx.topological_sort(model))
  
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 1 to create a new BayesianModelInference object from inherited base classes: Inference with example: obj = BayesianModelInference(model)