class_docstr: Represents a density estimator based on a Gaussian mixture model. The estimator uses the sklearn
  BayesianGaussianMixture model internally.
class_docstr_tok: ["Represents","a","density","estimator","based","on","a","Gaussian","mixture","model",".","The","estimator","uses","the","sklearn","BayesianGaussianMixture","model","internally","."]
code: def density(self, X: np.ndarray) -> np.ndarray:
      if self._gmm_model is None:
          raise RuntimeError(
              "%s has not been fitted!" % self.__class__.__name__
          )
  
      # Note, the output of score_samples are log values.
      return np.exp(self._gmm_model.score_samples(shape_into_2d(X)))
  
file_path: dowhy/dowhy/gcm/density_estimators.py
imports: from typing import Optional
  import numpy
  from sklearn.mixture import BayesianGaussianMixture
  from sklearn.neighbors import KernelDensity
  from dowhy.gcm.density_estimator import DensityEstimator
  from dowhy.gcm.util.general import shape_into_2d
label_desc: Use image node_id 3 for calling the GaussianMixtureDensityEstimator obj's underlying member method code with example usage: obj.density(X) and returns: np