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 fit(self, X: np.ndarray) -> None:
      if self._num_components is None:
          self._num_components = int(np.ceil(np.sqrt(X.shape[0] / 2)))
  
      self._gmm_model = BayesianGaussianMixture(
          n_components=self._num_components, covariance_type="full"
      ).fit(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 2 for calling the GaussianMixtureDensityEstimator obj's underlying member method code with example usage: obj.fit(X) without return types