class_docstr: The class implements Infinite Gaussian Mixture model
  or Dirichlet Process Mixture model.
  This is simply a generalization of Bayesian Gaussian Mixture Models
  with an unknown number of classes.
class_docstr_tok: ["The","class","implements","Infinite","Gaussian","Mixture","model","or","Dirichlet","Process","Mixture","model",".","This","is","simply","a","generalization","of","Bayesian","Gaussian","Mixture","Models","with","an","unknown","number","of","classes","."]
docstr: return the likelihood of the model for the data x
  the values are weighted by the components weights
  
  Parameters
  ----------
  x: array of shape (n_samples, self.dim),
     the data used in the estimation process
  plike: array of shape (n_samples), optional,
         the density of each point under the prior
  
  Returns
  -------
  like, array of shape (nbitem, self.k)
  component-wise likelihood
docstr_tok: ["return","the","likelihood","of","the","model","for","the","data","x","the","values","are","weighted","by","the","components","weights","Parameters","--","--","--","--","--","x",":","array","of","shape","(","n_samples",",","self.dim",")",",","the","data","used","in","the","estimation","process","plike",":","array","of","shape","(","n_samples",")",",","optional",",","the","density","of","each","point","under","the","prior","Returns","--","--","--","-","like",",","array","of","shape","(","nbitem",",","self.k",")","component-wise","likelihood"]
code: def likelihood(self, x, plike=None):
      """
      return the likelihood of the model for the data x
      the values are weighted by the components weights
  
      Parameters
      ----------
      x: array of shape (n_samples, self.dim),
         the data used in the estimation process
      plike: array of shape (n_samples), optional,
             the density of each point under the prior
  
      Returns
      -------
      like, array of shape (nbitem, self.k)
      component-wise likelihood
      """
      if plike is None:
          plike = self.likelihood_under_the_prior(x)
  
      plike = np.reshape(plike, (x.shape[0], 1))
      if self.k > 0:
          like = self.unweighted_likelihood(x)
          like = np.hstack((like, plike))
      else:
          like = plike
      like *= self.weights
      return like
  
imports: import math
  import numpy
  from scipy.special import gammaln
  from .bgmm import BGMM, detsh
label_desc: Use image node_id 12 for calling the IMM obj's underlying member method code with example usage: obj.likelihood(x, plike) and returns: like