class_docstr: Class to calculate probability (pmf) values specific to Bayesian Models
docstr: Evaluate the logarithmic probability of each point in a data set.
  
  Parameters
  ----------
  data: pandas dataframe OR array_like, shape (n_samples, n_features)
      List of n_features-dimensional data points.  Each row
      corresponds to a single data point.
  
  ordering: list
      ordering of columns in data, used by the Bayesian model.
      default is topological ordering used by model.
  
  Returns
  -------
  Log probability of each datapoint: np.array (n_samples,)
      The array of log(density) evaluations. These are normalized to be
      probability densities, so values will be low for high-dimensional
      data.
code: def log_probability(self, data, ordering=None):
      """
      Evaluate the logarithmic probability of each point in a data set.
  
      Parameters
      ----------
      data: pandas dataframe OR array_like, shape (n_samples, n_features)
          List of n_features-dimensional data points.  Each row
          corresponds to a single data point.
  
      ordering: list
          ordering of columns in data, used by the Bayesian model.
          default is topological ordering used by model.
  
      Returns
      -------
      Log probability of each datapoint: np.array (n_samples,)
          The array of log(density) evaluations. These are normalized to be
          probability densities, so values will be low for high-dimensional
          data.
      """
      if isinstance(data, pd.DataFrame):
          # use numpy array from now on.
          ordering = data.columns.to_list()
          data = data.values
      if ordering is None:
          ordering = self.topological_order
          data = data.loc[:, ordering].values
  
      logp = np.array(
          [
              self._log_probability_node(data, ordering, node)
              for node in ordering
          ]
      )
      return np.sum(logp, axis=0)
  
file_path: pgmpy/pgmpy/metrics/bn_inference.py
imports: import numpy
  import pandas
  from pgmpy.sampling import BayesianModelInference
label_desc: Use image node_id 3 for calling the BayesianModelProbability obj's underlying member method code with example usage: obj.log_probability(data, ordering) and returns: np